TestAdapter.GetUserTokenAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetUserTokenAsync(ITurnContext, AppCredentials, String, String, CancellationToken) |
Attempts to retrieve the token for a user that's in a login flow, using customized AppCredentials. |
GetUserTokenAsync(ITurnContext, String, String, CancellationToken) |
Attempts to retrieve the token for a user that's in a login flow, using the bot's AppCredentials. |
GetUserTokenAsync(ITurnContext, AppCredentials, String, String, CancellationToken)
Attempts to retrieve the token for a user that's in a login flow, using customized AppCredentials.
public virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> GetUserTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, Microsoft.Bot.Connector.Authentication.AppCredentials oAuthAppCredentials, string connectionName, string magicCode, System.Threading.CancellationToken cancellationToken);
abstract member GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
override this.GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * Microsoft.Bot.Connector.Authentication.AppCredentials * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Overridable Function GetUserTokenAsync (turnContext As ITurnContext, oAuthAppCredentials As AppCredentials, connectionName As String, magicCode As String, cancellationToken As CancellationToken) As Task(Of TokenResponse)
Parameters
- turnContext
- ITurnContext
Context for the current turn of conversation with the user.
- oAuthAppCredentials
- AppCredentials
AppCredentials for OAuth.
- connectionName
- String
Name of the auth connection to use.
- magicCode
- String
(Optional) Optional user entered code to validate.
- cancellationToken
- CancellationToken
Cancellation token.
Returns
Token Response or null if the token was not found.
Implements
Applies to
GetUserTokenAsync(ITurnContext, String, String, CancellationToken)
Attempts to retrieve the token for a user that's in a login flow, using the bot's AppCredentials.
public virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse> GetUserTokenAsync (Microsoft.Bot.Builder.ITurnContext turnContext, string connectionName, string magicCode, System.Threading.CancellationToken cancellationToken);
abstract member GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
override this.GetUserTokenAsync : Microsoft.Bot.Builder.ITurnContext * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.TokenResponse>
Public Overridable Function GetUserTokenAsync (turnContext As ITurnContext, connectionName As String, magicCode As String, cancellationToken As CancellationToken) As Task(Of TokenResponse)
Parameters
- turnContext
- ITurnContext
Context for the current turn of conversation with the user.
- connectionName
- String
Name of the auth connection to use.
- magicCode
- String
(Optional) user entered code to validate.
- cancellationToken
- CancellationToken
Cancellation token.
Returns
Token Response or null if the token was not found.