/** @packageDocumentation * @module Authentication */ import { UserInfo } from "./UserInfo"; /** @internal */ export declare enum IncludePrefix { Yes = 0, No = 1 } /** Base class for JWT and SAML tokens * @beta */ export declare abstract class Token { protected _samlAssertion?: string; protected _saml?: string; protected _jwt?: string; protected _userInfo?: UserInfo; protected _startsAt?: Date; protected _expiresAt?: Date; protected _x509Certificate?: string; protected constructor(); /** @internal */ protected getSaml(): string | undefined; /** @internal */ getSamlAssertion(): string | undefined; /** @internal */ getUserInfo(): UserInfo | undefined; /** @internal */ setUserInfo(userInfo: UserInfo): void; /** @internal */ getExpiresAt(): Date | undefined; /** @internal */ getStartsAt(): Date | undefined; /** @internal */ protected parseSamlAssertion(): boolean; } /** Token issued by Active Secure Token Service or Federated Authentication Service for user authentication/authorization * @internal */ export declare class AuthorizationToken extends Token { /** Sets up a new AuthorizationToken based on the SAML that was passed in. * Does NOT validate the resulting token. * @internal */ static fromSamlAssertion(samlAssertion: string): AuthorizationToken; /** Creates a string representation of the contained token * @internal */ toTokenString(includePrefix?: IncludePrefix): string; } /** Token issued by DelegationSecureTokenService for API access * @beta */ export declare class AccessToken extends Token { private static _samlTokenPrefix; private static _jwtTokenPrefix; static foreignProjectAccessTokenJsonProperty: string; private _foreignJwt?; /** Returns true if it's a Json Web Token, and false if it's a SAML token * @internal */ get isJwt(): boolean; /** Sets up a new AccessToken based on the SAML that was passed in. * Does NOT validate the resulting token. * @internal */ static fromSamlAssertion(samlAssertion: string): AccessToken; /** Sets up a new AccessToken based on some generic token abstraction used for iModelBank use cases * @internal */ static fromForeignProjectAccessTokenJson(foreignJsonStr: string): AccessToken | undefined; /** Create an AccessToken from a SAML string for Windows Federated Authentication workflows. * Does NOT validate the token. * @internal */ static fromSamlTokenString(accessTokenStr: string, includesPrefix?: IncludePrefix): AccessToken; /** Create an AccessToken from a JWT token for OIDC workflows * Does NOT validate the token. * @internal */ static fromJsonWebTokenString(jwt: string, startsAt?: Date, expiresAt?: Date, userInfo?: UserInfo): AccessToken; /** * Convert this AccessToken to a string * @param includePrefix Include the token prefix to identify JWT or SAML tokens * @internal */ toTokenString(includePrefix?: IncludePrefix): string; /** * Create an AccessToken from a string. The token must include the prefix to differentiate between JWT and SAML. * @param tokenStr String representation of the token * @internal */ static fromTokenString(tokenStr: string): AccessToken; /** * Creates an AccessToken from an untyped JSON object * @param jsonObj * @internal */ static fromJson(jsonObj: any): AccessToken | undefined; } //# sourceMappingURL=Token.d.ts.map