Language

OAuthFlow Class

Definition

Provides a high-level abstraction for Teams Bot SSO authentication. Encapsulates silent token acquisition, SSO token exchange, fallback sign-in, and sign-out.

public class OAuthFlow
type OAuthFlow = class
Public Class OAuthFlow
Inheritance
OAuthFlow

Properties

Name Description
ConnectionName

The OAuth connection name.

Methods

Name Description
GetConnectionStatusAsync<TActivity>(Context<TActivity>, CancellationToken)

Get the token status for all configured OAuth connections. This calls GetTokenStatus which returns every connection registered on the bot, so the developer never needs to enumerate connection names manually.

GetTokenAsync<TActivity>(Context<TActivity>, CancellationToken)

Attempt silent token acquisition from the Bot Framework Token Store.

IsSignedInAsync<TActivity>(Context<TActivity>, CancellationToken)

Check whether the user has a valid cached token for this flow's connection.

OnSignInComplete(SignInCompleteHandler)

Register a callback invoked after a successful token exchange (SSO or fallback sign-in).

OnSignInFailure(SignInFailureHandler)

Register a callback invoked when token exchange fails.

SignInAsync<TActivity>(Context<TActivity>, CancellationToken)

Attempt silent token acquisition; if no token is available, send an OAuthCard to initiate the SSO flow.

SignInAsync<TActivity>(Context<TActivity>, OAuthOptions, CancellationToken)

Attempt silent token acquisition; if no token is available, send an OAuthCard to initiate the SSO flow.

SignOutAsync<TActivity>(Context<TActivity>, CancellationToken)

Sign the user out, revoking their token from the Bot Framework Token Store.

Applies to