Language

UserTokenClient Class

Definition

Client for managing user tokens via HTTP requests to the Bot Framework Token Service.

public class UserTokenClient
type UserTokenClient = class
Public Class UserTokenClient
Inheritance
UserTokenClient

Remarks

This client provides methods for OAuth token management including retrieving tokens, exchanging tokens, signing out users, and managing AAD tokens. The client communicates with the Bot Framework Token Service API endpoint (defaults to https://token.botframework.com but can be configured via UserTokenApiEndpoint).

Constructors

Name Description
UserTokenClient(HttpClient, IConfiguration, ILogger<UserTokenClient>)

Client for managing user tokens via HTTP requests to the Bot Framework Token Service.

Methods

Name Description
ExchangeTokenAsync(String, String, String, String, BotRequestContext, CancellationToken)

Exchanges a token for another token.

GetAadTokensAsync(String, String, String, String[], BotRequestContext, CancellationToken)

Gets AAD tokens for a user.

GetSignInResourceAsync(String, String, String, String, BotRequestContext, CancellationToken)

Get the token or raw signin link to be sent to the user for signin for a connection. Builds the state parameter internally from the userId and connectionName.

GetSignInResourceAsync(String, String, Uri, Uri, BotRequestContext, CancellationToken)

Gets the sign-in resource for the given state.

GetSignInUrlAsync(String, String, Uri, Uri, BotRequestContext, CancellationToken)

Gets the sign-in URL for the given state.

GetTokenAsync(String, String, String, String, BotRequestContext, CancellationToken)

Gets the user token for a particular connection.

GetTokenStatusAsync(String, String, String, BotRequestContext, CancellationToken)

Gets the token status for each connection for the given user.

SignOutUserAsync(String, String, String, BotRequestContext, CancellationToken)

Signs the user out of a connection, revoking their OAuth token.

Applies to