Sceenic - WatchTogether
  • Watch Together and Synchronization SDKs
  • Watch together SDK
    • Watch Together SDK overview
    • Authentication overview
    • Tutorials
      • Android
        • Android - Java/Kotlin
      • iOS
        • iOS Swift/Objective-c adapter
      • Web
        • Authentication
        • Create a New Project
        • Adding WT SDK library to the project
        • Installing the NPM package
        • Sample application
          • The conference skeleton
          • Connecting to a Session
          • How to turn on and off video and audio
          • How to change video quality
          • Errors handling
          • Leave the call
        • Support
    • API references
      • Android reference
        • Session
        • SessionListener
        • SessionReconnectListener
        • SessionConnectionListener
        • Participant
          • ParticipantType
        • SessionError
      • iOS Swift reference
        • Session
        • SessionDelegate
        • Participant
        • ParticipantActiveSpeakerDelegate
        • ParticipantDelegate
        • LocalParticipant
        • WTError
        • DataTypes
      • iOS Objective-c adapter reference
        • SessionAdapter
        • SessionAdapterDelegate
        • ParticipantAdapter
        • LocalParticipantAdapter
        • ParticipantAdpaterDelegate
        • ParticipantAdapterActiveSpeakerDelegate
        • NSError
        • DataTypes
      • Web reference
        • WT Session
          • WTSession.connect(sToken, pName, uC, m)
          • WTSession.connectAsAViewer(sToken, pName)
          • WTSession.connectWithSharingScreen(sToken, pName)
          • WTSession.disconnect()
          • WTSession.enableStats()
          • WTSession.sendMessage(msg)
          • WTSession.sendPlayerData(time)
          • async WTSession.getSessionState()
        • SessionListeners
          • WTSessionListeners.onConnected(fn)
          • WTSessionListeners.onDisconnected(fn)
          • WTSessionListeners.onStreamCreated(fn)
          • WTSessionListeners.onLocalStreamCreated(fn)
          • WTSessionListeners.onMosReport(fn)
          • WTSessionListeners.offMosReport(fn)
          • WTSessionListeners.onMessageReceived(fn)
          • WTSessionListeners.onSyncData(fn)
          • WTSessionListeners.onIceDisconnected(fn)
        • Participant
          • setMediaQuality
        • ParticipantListeners
        • ErrorsListeners
        • ReconnectListeners
        • MediaDevices
      • Cluster authentication service reference (CAS)
  • Synchronization SDK
    • Synchronization SDK overview
    • Tutorials
      • Android
        • Android - Java/Kotlin
      • iOS
        • iOS - Swift/Objective-c
      • Web
        • Installing the NPM package
        • Web - TypeScript/React
        • v2.0 Migration Guide
    • API references
      • Android reference
        • SynchSDK
        • SynchListener
      • iOS reference
        • SynchSDK
        • SynchListener
      • Web reference
  • Celebrity SDK
    • Celebrity SDK overview
    • Tutorials
      • Web
        • Installing the NPM package
        • Web - TypeScript/React
    • API References
      • Web reference
  • Chat SDK
    • Chat SDK overview
    • Tutorials
      • Web
        • Installing the NPM package
        • Web - TypeScript/React
    • API Refences
      • Web reference
  • Public Chat SDK
    • Public Chat SDK overview
    • Tutorials
      • Web
        • Installing the NPM package
        • Web - TypeScript/React
    • API Refences
      • Web reference
  • Celebrity Watch Party
    • Web application
    • Android
    • iOS
    • Celebrity View & Fan View
Powered by GitBook
On this page
  • Acquiring an Access Token
  • Going to production

Was this helpful?

  1. Watch together SDK
  2. Tutorials
  3. Web

Authentication

PreviousWebNextCreate a New Project

Last updated 1 year ago

Was this helpful?

Have a look at the and .

An Access Token is needed in order to allow a client to connect to a Session.

Note: It is important that the client application does not request an Access Token directly from the frontend. By doing that you risk exposing the API_TOKEN and API_SECRET.

  • To learn how to acquire an Access Token please look at the (CAS) reference

  • To simplify the tutorial, in the section below you can see an example of getting an Access Token.

Acquiring an Access Token

curl -iL --request GET --url https://YOUR_CAS_URL/stream/token/v2/ --header 'auth-api-key: API_KEY'   --header 'auth-api-secret: API_SECRET'

The Access Token is a JWT token - more about jwt you can read - .

A successful response will look like that:

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...."
}

You can get your API_KEY and API_SECRET in your private area, .

Note: Every Streaming Token corresponds to one specific Session only. To allow two different clients to connect to the same Session, the clients need to use the same Access Token.

Going to production

When moving from the Sandbox environment to production you will need to implement your own authentication server. This server will supply the various clients (Web, Android, and iOS) with a valid Access Token so that they can use the service.

For that you will need:

API_KEY, and API_SECRET - can be retrieved in your private area once you

Your own working authentication server -

Authentication overview
Watch Together overview
Cluster Authentication Server
here
here
login
Authentication overview