SSO Authentication

Get User Licenses

After obtaining an SSO token from your identity provider, call getUserLicenses to retrieve all licenses associated with the authenticated user. This is useful for letting users choose which license to activate in multi-license scenarios. The method requires the raw SSO token and the redirect URI registered with your SSO provider. The returned array contains full license objects that can be passed directly into activation flows.

let ssoToken = "<token-from-idp>"
let redirectURI = "https://localhost:3000"

let licenses = try licenseManager.getUserLicenses(
    ssoToken: ssoToken,
    redirectURI: redirectURI
)

Activate a License via SSO

Pass the SSO token and redirect URI to activateLicense instead of a traditional license key. On success, the returned License object is stored in currentLicense and can be used for all subsequent operations. Ensure the token is fresh, SSO tokens are short-lived and activation will fail with an expired one.

let license = try licenseManager.activateLicense(
    ssoToken: ssoToken,
    redirectURI: redirectURI
)

Note: Tokens are single-use and expire quickly. Always fetch a new token immediately before calling activation.

Last updated

Was this helpful?