/** @packageDocumentation * @module iTwinServiceClients */ import { ClientRequestContext } from "@bentley/bentleyjs-core"; import { IAuthorizationClient } from "./AuthorizationClient"; import { Client } from "./Client"; import { RequestOptions } from "./Request"; import { AccessToken, AuthorizationToken } from "./Token"; /** Interface for user credentials for programmatic login to IMS * Note: This can only be used in test environments. In a real application, the password cannot be explicitly used in any API. * @internal * @deprecated Will be removed in iModel.js 2.0. */ export interface ImsUserCredentials { email: string; password: string; } /** Client API for the IMS Federated Authentication Service. * @internal * @deprecated Will be removed in iModel.js 2.0. */ export declare class ImsFederatedAuthenticationClient extends Client { static readonly searchKey: string; /** Creates an instance of ImsFederatedAuthenticationClient. */ constructor(); /** Gets name/key to query the service URLs from the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected getUrlSearchKey(): string; /** Parses the response from the token request to obtain the token and the user profile. * @param authTokenResponse Response for the token request. */ static parseTokenResponse(authTokenResponse: string): AuthorizationToken | undefined; } /** Client API for the IMS Active Secure Token Service. * @internal * @deprecated Will be removed in iModel.js 2.0. */ export declare class ImsActiveSecureTokenClient extends Client { static readonly searchKey: string; /** * Creates an instance of ImsActiveSecureTokenClient. */ constructor(); /** * Gets name/key to query the service URLs from the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected getUrlSearchKey(): string; protected setupOptionDefaults(options: RequestOptions): Promise; /** * Gets the authorization token given the credentials. * Note that this can only be used in test environments - in an application passwords are never passed around, and the * application would/should not be aware of it. * @param userCredentials User credentials * @returns Resolves to the token and user profile. */ getToken(requestContext: ClientRequestContext, userCredentials: ImsUserCredentials, appId?: string): Promise; } /** Client API for the IMS Delegation Secure Token Service. * @internal * @deprecated Will be removed in iModel.js 2.0. */ export declare class ImsDelegationSecureTokenClient extends Client { static readonly searchKey: string; /** * Creates an instance of ImsDelegationSecureTokenClient. */ constructor(); /** * Gets name/key to query the service URLs from the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected getUrlSearchKey(): string; /** * Gets the default URL for the service. * @returns Default URL for the service. */ protected setupOptionDefaults(options: RequestOptions): Promise; /** * Gets the (delegation) access token given the authorization token. * @param requestContext The client request context * @param authTokenInfo Access token. * @param relyingPartyUri Relying party URI required by the service - defaults to a value defined by the configuration. * @param appId Application id that's used for logging and tracing the authorization request * @returns Resolves to the (delegation) access token. */ getToken(requestContext: ClientRequestContext, authorizationToken: AuthorizationToken, relyingPartyUri?: string, appId?: string): Promise; } /** Implementation of IAuthorizationClient using IMS - this is only used in test environments * @internal * @deprecated Will be removed in iModel.js 2.0. */ export declare class ImsTestAuthorizationClient implements IAuthorizationClient { private _accessToken?; private _userCredentials?; private _relyingPartyUri?; signIn(requestContext: ClientRequestContext, userCredentials: ImsUserCredentials, relyingPartyUri?: string): Promise; /** Returns true if there's a current authorized user or client (in the case of agent applications). * Returns true if signed in and the access token has not expired, and false otherwise. */ get isAuthorized(): boolean; /** Returns true if the user has signed in, but the token has expired and requires a refresh */ get hasExpired(): boolean; /** Returns true if the user has signed in, but the token has expired and requires a refresh */ get hasSignedIn(): boolean; /** Returns a promise that resolves to the AccessToken of the currently authorized user * or authorized client (in the case of agent applications). * The token is refreshed if necessary and possible. * @throws [[BentleyError]] If the client was not used to authorize, or there was an authorization error. */ getAccessToken(requestContext?: ClientRequestContext): Promise; } //# sourceMappingURL=ImsClients.d.ts.map