import { GenerateTokenFromCodeRequest } from "./TokenService.model"; import { HTTPRequestHeader, LoginPrecheckRequest } from "../common/Common.model"; import ConfigUserProvider from "../common/ConfigUserProvider"; export declare class TokenService { private config; private userManager; constructor(configUserProvider: ConfigUserProvider); /** * 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. * @example * ```js * 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 * }); * ``` */ generateTokenFromCode(options: GenerateTokenFromCodeRequest): Promise; /** * 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. * @example * ```js * 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 * }); * ``` */ loginPrecheck(options: LoginPrecheckRequest, headers?: HTTPRequestHeader): Promise; /** * 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. * @example * ```js * const trackId = "your track id from login"; * cidaasTokenService.getMissingFields(trackId) * .then(function (response) { * // type your code here * }) * .catch(function (ex) { * // your failure code here * }); * ``` */ getMissingFields(trackId: string, headers?: HTTPRequestHeader): Promise; /** * 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. * @example * ```js * const clientId = "your client id"; * cidaasTokenService.initiateDeviceCode(clientId) * .then(function (response) { * // type your code here * }) * .catch(function (ex) { * // your failure code here * }); * ``` */ initiateDeviceCode(clientId?: string): Promise; /** * To verify device code, call **deviceCodeVerify()**. * @example * ```js * 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 * }); * ``` */ deviceCodeVerify(code: string): void; /** * 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. * @example * ```js * cidaasTokenService.offlineTokenCheck('your access token'); * ``` */ offlineTokenCheck(accessToken: string): { isExpiryDateValid: boolean; isScopesValid: boolean; isIssuerValid: boolean; }; }