cxengage-javascript-sdk.modules.authentication

get-auth-info

(get-auth-info & args__9078__auto__)

The getAuthInfo function is used to retrieve a user’s Single Sign On details, and when used in conjunction with the popIdentityPage function - will open a window for a user to sign into their third party SAML provider. There are multiple ways to call this function to get a particular identity provider for a user. The first way is to simply use their email - which will grab their default tenant’s ‘client’ and ‘domain’ fields.

CxEngage.authentication.getAuthInfo({
    username: '{{string}}'
})

The second way to use this function is to specify a tenant ID - which will be used to retrieve that tenant’s default identity provider information in order to open the third party sign on window.

CxEngage.authentication.getAuthInfo({
    tenantId: '{{uuid}}'
})

The third way is to specify an identity provider ID in addition to a tenant ID in order to retrieve the information if it is not the default identity provider on the tenant.

CxEngage.authentication.getAuthInfo({
    tenantId: '{{uuid}}',
    idpId: '{{uuid}}'
})

Possible Errors:

login

(login & args__9078__auto__)

The login function is able to be called two different ways. Either with a username and password, or a token. When logging in with a username and password you can optionally pass a TTL as well.

CxEngage.authentication.login({
  username: '{{string}}',
  password: '{{string}}',
  ttl: '{{number}}',
  noStateReset: '{{boolean}}'
});
CxEngage.authentication.login({
  token: '{{string}}'
});

Possible Errors:

logout

(logout & args__9078__auto__)
CxEngage.authentication.logout();

Logs the active Agent out, and sets their state to ‘Offline’. This function is unable to be called if there are any active interactions.

Possible Errors:

pop-identity-page

(pop-identity-page & args__9078__auto__)

The popIdentityPage function is used to open a third party Single Sign On provider using the information gathered from the getAuthInfo function. This information is stored in the SDK’s internal state, and does not require it passed in as parameters. We require this to be a separate function in order to bypass the browser’s popup blocker. A window with the name ‘cxengageSsoWindow’ must first be previously opened in response to a user event to prevent being blocked by default popup blockers.

window.open('', 'cxengageSsoWindow', 'width=500,height=500');
CxEngage.authentication.popIdentityPage();

update-default-tenant

(update-default-tenant & args__9078__auto__)