/** @packageDocumentation * @module Authentication */ import { ClientRequestContext } from "@bentley/bentleyjs-core"; import { AccessToken, AuthorizationClient } from "@bentley/itwin-client"; import { BackendAuthorizationClient, BackendAuthorizationClientConfiguration } from "./BackendAuthorizationClient"; /** * Configuration of clients for agent or service applications. * @see [[AgentAuthorizationClient]] for notes on registering an application * @beta */ export declare type AgentAuthorizationClientConfiguration = BackendAuthorizationClientConfiguration; /** * Configuration of clients for agent or service applications. * @see [[AgentAuthorizationClient]] for notes on registering an application * @deprecated Use [[AgentAuthorizationClient]] instead * @beta */ export declare type OidcAgentClientConfiguration = AgentAuthorizationClientConfiguration; /** * Utility to generate OIDC/OAuth tokens for agent or agent applications * @deprecated Use [[AgentAuthorizationClient]] instead * @beta */ export declare type OidcAgentClient = AgentAuthorizationClient; /** * Utility to generate OIDC/OAuth tokens for agent or agent applications * * The application must register a client using the * [self service registration page](https://developer.bentley.com/register/). * * The client type must be "Agent" * * Use the Client Id/Client Secret/Scopes to create the agent configuration that's passed in. * * Ensure the application can access the iTwin Project/Asset - in production environments, this is done by * using the iTwin project portal to add add the email **`{Client Id}@apps.imsoidc.bentley.com`** as an authorized user * with the appropriate role that includes the required access permissions. * @beta */ export declare class AgentAuthorizationClient extends BackendAuthorizationClient implements AuthorizationClient { private _accessToken?; constructor(agentConfiguration: AgentAuthorizationClientConfiguration); private generateAccessToken; /** * Get the access token * @deprecated Use [[AgentAuthorizationClient.getAccessToken]] instead. */ getToken(requestContext: ClientRequestContext): Promise; /** * Refresh the access token - simply checks if the token is still valid before re-fetching a new access token * @deprecated Use [[AgentAuthorizationClient.getAccessToken]] instead to always get a valid token. */ refreshToken(requestContext: ClientRequestContext, jwt: AccessToken): Promise; /** * Set to true if there's a current authorized user or client (in the case of agent applications). * Set to true if signed in and the access token has not expired, and false otherwise. */ get isAuthorized(): boolean; /** Set to true if the user has signed in, but the token has expired and requires a refresh */ get hasExpired(): boolean; /** Set to true if signed in - the accessToken may be active or may have expired and require a refresh */ get hasSignedIn(): boolean; /** Returns a promise that resolves to the AccessToken of the currently authorized client. * The token is refreshed if necessary. */ getAccessToken(requestContext?: ClientRequestContext): Promise; } //# sourceMappingURL=AgentAuthorizationClient.d.ts.map