constructor for CXoneAuth
Checks if instance is leader or not
Method to create singleton object of the class
Encrypts a given token using the provided CryptoKey.
The token to be encrypted.
The CryptoKey used for encryption.
A promise that resolves to a JSONWebKey containing the encrypted token and initialization vector.
Generates a cryptographic key, encrypts it, and stores it in local storage.
The user ID used to derive the secondary encryption key.
A promise that resolves to the generated CryptoKey.
Method to generate the access token and call the getCXoneConfiguration method in the response to get the api endpoint url from the cxone configuration.
request object containing client id & generated code after authenticate
method to generate new token using existing token
request object containing host url and existing access token
This method returns the Authorization Token Endpoint
icClusterId
domain
Checks if user is logged in and have valid token
Method generate the Authorize url using authorize endpoint with clientId, code challenge, authMode and codeChallengeMethod. This url will be use to open the login screen in page or popup window based on the display value.
get the authmode, whether page or popup
'S256'
authUrl
Method to return branding profiles
@example
getBrandingProfile()
Method to return business unit features
@example
getBusinessUnit()
This method is to get CXone Configurations for authentication purpose
tenantId
@example
getCXoneConfiguration('https://cxone.dev.niceincontact.com','11e85da0-f32c-7e10-898c-0242ac110003');
Retrieves a CryptoKey by decrypting an encrypted key using a derived key.
The user ID used to derive the secondary key.
The encrypted key that needs to be decrypted.
The initialization vector used for decryption.
A promise that resolves to a CryptoKey.
Retrieves and decrypts the authentication token stored in local storage.
A promise that resolves to the decrypted authentication token, or null if decryption fails.
Check if token is impersonated token
token
Method to get JWKS for verifing jwt token
Method to get discovery endpoints for authentication purposes
Retrieves or generates a cryptographic key for the specified user.
The ID of the user for whom the cryptographic key is being retrieved or generated.
A promise that resolves to the cryptographic key.
Method to return business unit features
@example
getBusinessUnit()
Used to fetch the new access token when the old token is expired the authentication end point we will get from localstorage object 'discovery_response'
method to generate new token using existing token using regional token exchange service
request object containing host url and existing access token
impersonating user details
Used to fetch the new access token using regional token endpoint when the old token is expired
Method to return active user details
@example
getUserDetails()
Fetch the user details of logged in user
Method to get the whoami api response
'authToken'
initialize the auth settings
Use to initializing the util worker and will return the method inside the worker
Method to check token is expired or not
Method to launch CXoneAgent application from SDK
Target div id wherein application needs to be loaded
Application url that needs to be launched
css style params to be applied to iframe
Method used to parse the auth token, user info and store the values to local storage
authToken response
flag to decide whether to set user info or not
impersonating user details
Event handler to receive message event from auth callback popup
restores data and re-initiates auth flow
Method used to process parsed auth token and set user info object
parsed authToken
flag to decide whether to set user info or not
user details
authToken object
cxone configuration object
Encrypts the provided authentication token and stores it in local storage.
The authentication token to be encrypted and stored.
A promise that resolves when the token has been successfully encrypted and stored.
Used to start the check for refresh token Here, first we will initiate the worker which have a timeout, this timeout will get triggered based on the expiry time of the token we have passed Once the expiry time is reached the worker will execute the callback to get the refresh token that we have passed
token object which will have refresh token and the expire in detail required to obtain the new token
defines if instance is leader or not
Subscription for empty auth token
Subscription for response message over broadcast channel
Method to terminate util worker
Use to terminate the util worker instance
Method to check Ft and save auth token
authToken to be saved
Validates if the feature toggle for token encryption is enabled and retrieves the decrypted token.
A promise that resolves to the decrypted authentication token, or null if decryption fails or the feature toggle is disabled.
Method to verify JWT
Generated using TypeDoc
Class to perform common authentication of user