botframework-connector
Version:
Bot Connector is autorest generated connector client.
76 lines • 4.2 kB
TypeScript
import type { ServiceClientCredentials } from '@azure/core-http';
import { Activity, SignInUrlResponse, TokenExchangeRequest, TokenResponse, TokenStatus } from 'botframework-schema';
import { ConnectorClientOptions } from '../connectorApi/models';
import { UserTokenClient } from './userTokenClient';
/**
* @internal
* Implementation of [UserTokenClient](xref:botframework-connector.UserTokenClient) for access user token service.
*/
export declare class UserTokenClientImpl extends UserTokenClient {
private readonly appId;
private readonly client;
/**
* @param appId The appId.
* @param credentials AppCredentials for OAuth.
* @param oauthEndpoint The OAuth API endpoint.
* @param connectorClientOptions A ConnectorClientOptions object.
*/
constructor(appId: string, credentials: ServiceClientCredentials, oauthEndpoint: string, connectorClientOptions?: ConnectorClientOptions);
/**
* Attempts to retrieve the token for a user that's in a login flow.
*
* @param userId The user id that will be associated with the token.
* @param connectionName Name of the auth connection to use.
* @param channelId The channel Id that will be associated with the token.
* @param magicCode (Optional) Optional user entered code to validate.
* @returns The token Response.
*/
getUserToken(userId: string, connectionName: string, channelId: string, magicCode: string): Promise<TokenResponse>;
/**
* Asynchronously Get the raw signin resource to be sent to the user for signin.
*
* @param connectionName Name of the auth connection to use.
* @param activity The Activity from which to derive the token exchange state.
* @param finalRedirect The final URL that the OAuth flow will redirect to.
* @returns The [SignInUrlResponse](xref:botframework-schema.SignInUrlResponse) resource.
*/
getSignInResource(connectionName: string, activity: Activity, finalRedirect: string): Promise<SignInUrlResponse>;
/**
* Signs the user out with the token server.
*
* @param userId The user id that will be associated with the token.
* @param connectionName Name of the auth connection to use.
* @param channelId The channel Id that will be associated with the token.
*/
signOutUser(userId: string, connectionName: string, channelId: string): Promise<void>;
/**
* Retrieves the token status for each configured connection for the given user.
*
* @param userId The user id that will be associated with the token.
* @param channelId The channel Id that will be associated with the token.
* @param includeFilter The includeFilter.
* @returns A promise with an Array of the Token Status.
*/
getTokenStatus(userId: string, channelId: string, includeFilter: string): Promise<TokenStatus[]>;
/**
* Retrieves Azure Active Directory tokens for particular resources on a configured connection.
*
* @param userId The user id that will be associated with the token.
* @param connectionName Name of the auth connection to use.
* @param resourceUrls The list of resource URLs to retrieve tokens for.
* @param channelId The channel Id that will be associated with the token.
* @returns A promise of Dictionary of resourceUrl to the corresponding TokenResponse.
*/
getAadTokens(userId: string, connectionName: string, resourceUrls: string[], channelId: string): Promise<Record<string, TokenResponse>>;
/**
* Performs a token exchange operation such as for single sign-on.
*
* @param userId The user id that will be associated with the token.
* @param connectionName Name of the auth connection to use.
* @param channelId The channel Id that will be associated with the token.
* @param exchangeRequest The exchange request details, either a token to exchange or a uri to exchange.
* @returns A promise representing the result of the operation.
*/
exchangeToken(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest): Promise<TokenResponse>;
}
//# sourceMappingURL=userTokenClientImpl.d.ts.map