Single Sign-on

The Single Sign-on flow for the SDK authentication

Toky Phone JS SDK Authentication

Setting up SSO for SDK Authentication

Allow agents to securely authenticate to Toky Phone JS SDK using Toky’s Single Sign-on (SSO).

Single sign-on is an authentication method that enables users to access multiple applications with one login and one set of credentials. For this case, after a user logs in to the Toky Web-app, they can use this session to authenticate against the Toky Phone JS SDK, and from that starting point, we can request an access token using Toky’s JWT endpoints.
To start the authentication flow, we need to follow the next steps:

import TokySDK from 'toky-phone-js-sdk'

const { TokyClient } = TokySDK

const Client = new TokyClient({
  accessToken: '{{access_token}}',
  account: {
    user: '[email protected]',
    type: 'agent',
  },
  transportLib: 'sip.js',
})

await Client.init()

If you have any questions about this process, please contact [email protected]