Constructors

Methods

  • To verify device code, call deviceCodeVerify().

    Parameters

    • code: string

    Returns void

    const code = "your code which has been send after initiateDeviceCode()";
    cidaasTokenService.deviceCodeVerify(code)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To generate token(s) with the grant type authorization_code, call generateTokenFromCode() Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4ff850f48629a-generate-token for more details.

    Parameters

    Returns Promise<any>

    const options = {
    code: "your code to be exchanged with the token(s)",
    }

    cidaasTokenService.generateTokenFromCode(options)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To get the missing fields after login, call getMissingFields(). Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.

    Parameters

    Returns Promise<any>

    const trackId = "your track id from login";
    cidaasTokenService.getMissingFields(trackId)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To initiate device code, call initiateDeviceCode(). Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/b6d284f55be5e-authorization-request for more details.

    Parameters

    • OptionalclientId: string

    Returns Promise<any>

    const clientId = "your client id";
    cidaasTokenService.initiateDeviceCode(clientId)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To get precheck result after login, call loginPrecheck(). If there is missing information, user will be redirected to either accepting consent, changing password, continuing MFA process, or do progressive registration Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.

    Parameters

    Returns Promise<any>

    const options = {
    track_id: "your track id from login",
    }

    cidaasTokenService.loginPrecheck(options)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To check access token without having to call cidaas api, call offlineTokenCheck(). THe function will return true if the token is valid & false if the token is invalid.

    Parameters

    • accessToken: string

    Returns { isExpiryDateValid: boolean; isIssuerValid: boolean; isScopesValid: boolean }

    cidaasTokenService.offlineTokenCheck('your access token');