Microsoft.Bot.Connector.BotAuthenticator Class Reference

Public Member Functions

 BotAuthenticator (string microsoftAppId, string microsoftAppPassword)
 Creates an instance of bot authenticator. More...
 
 BotAuthenticator (ICredentialProvider credentialProvider)
 
 BotAuthenticator (ICredentialProvider credentialProvider, string openIdConfigurationUrl, bool disableEmulatorTokens)
 
async Task< bool > TryAuthenticateAsync (HttpRequestMessage request, IEnumerable< IActivity > activities, CancellationToken token)
 Authenticates the incoming request and add the IActivity.ServiceUrl for each activities to MicrosoftAppCredentials.TrustedHostNames if the request is authenticated. More...
 
async Task< IdentityTokenTryAuthenticateAsync (string scheme, string token, CancellationToken cancellationToken)
 

Static Public Member Functions

static HttpResponseMessage GenerateUnauthorizedResponse (HttpRequestMessage request)
 Generates HttpStatusCode.Unauthorized response for the request. More...
 

Detailed Description

Definition at line 18 of file BotAuthenticator.cs.

Constructor & Destructor Documentation

Microsoft.Bot.Connector.BotAuthenticator.BotAuthenticator ( string  microsoftAppId,
string  microsoftAppPassword 
)
inline

Creates an instance of bot authenticator.

Parameters
microsoftAppIdThe Microsoft app Id.
microsoftAppPasswordThe Microsoft app password.

This constructor sets the openIdConfigurationUrl to JwtConfig.ToBotFromChannelOpenIdMetadataUrl and doesn't disable the self issued tokens used by emulator.

Definition at line 33 of file BotAuthenticator.cs.

Microsoft.Bot.Connector.BotAuthenticator.BotAuthenticator ( ICredentialProvider  credentialProvider)
inline

Definition at line 41 of file BotAuthenticator.cs.

Microsoft.Bot.Connector.BotAuthenticator.BotAuthenticator ( ICredentialProvider  credentialProvider,
string  openIdConfigurationUrl,
bool  disableEmulatorTokens 
)
inline

Definition at line 46 of file BotAuthenticator.cs.

Member Function Documentation

static HttpResponseMessage Microsoft.Bot.Connector.BotAuthenticator.GenerateUnauthorizedResponse ( HttpRequestMessage  request)
inlinestatic

Generates HttpStatusCode.Unauthorized response for the request.

Parameters
requestThe request.
Returns
A response with status code unauthorized.

Definition at line 80 of file BotAuthenticator.cs.

async Task<bool> Microsoft.Bot.Connector.BotAuthenticator.TryAuthenticateAsync ( HttpRequestMessage  request,
IEnumerable< IActivity activities,
CancellationToken  token 
)
inline

Authenticates the incoming request and add the IActivity.ServiceUrl for each activities to MicrosoftAppCredentials.TrustedHostNames if the request is authenticated.

Parameters
requestThe request that should be authenticated.
activitiesThe activities extracted from request.
tokenThe cancellation token.
Returns

Definition at line 67 of file BotAuthenticator.cs.

async Task<IdentityToken> Microsoft.Bot.Connector.BotAuthenticator.TryAuthenticateAsync ( string  scheme,
string  token,
CancellationToken  cancellationToken 
)
inline

Definition at line 130 of file BotAuthenticator.cs.


The documentation for this class was generated from the following file: