Language

JwtExtensions.AddBotAuthentication Method

Definition

Overloads

Name Description
AddBotAuthentication(IServiceCollection, String, ILogger)

Adds JWT authentication for bots and agents using configuration from appsettings.

AddBotAuthentication(AuthenticationBuilder, String, String, String, ILogger)

Adds JWT authentication for bots and agents to an existing authentication builder. Use this overload when registering multiple authentication schemes to avoid calling AddAuthentication() multiple times.

AddBotAuthentication(IServiceCollection, String, String, String, ILogger)

Adds JWT authentication for bots and agents with manually provided configuration values.

AddBotAuthentication(IServiceCollection, String, ILogger)

Adds JWT authentication for bots and agents using configuration from appsettings.

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBotAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string aadSectionName = "AzureAd", Microsoft.Extensions.Logging.ILogger? logger = default);
static member AddBotAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Microsoft.Extensions.Logging.ILogger -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddBotAuthentication (services As IServiceCollection, Optional aadSectionName As String = "AzureAd", Optional logger As ILogger = Nothing) As AuthenticationBuilder

Parameters

services
IServiceCollection

The service collection to add authentication to.

aadSectionName
String

The configuration section name for the settings. Defaults to "AzureAd".

logger
ILogger

The logger instance for logging.

Returns

An AuthenticationBuilder for further authentication configuration.

Applies to

AddBotAuthentication(AuthenticationBuilder, String, String, String, ILogger)

Adds JWT authentication for bots and agents to an existing authentication builder. Use this overload when registering multiple authentication schemes to avoid calling AddAuthentication() multiple times.

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBotAuthentication(this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string clientId, string tenantId = "", string schemeName = "AzureAd", Microsoft.Extensions.Logging.ILogger? logger = default);
static member AddBotAuthentication : Microsoft.AspNetCore.Authentication.AuthenticationBuilder * string * string * string * Microsoft.Extensions.Logging.ILogger -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddBotAuthentication (builder As AuthenticationBuilder, clientId As String, Optional tenantId As String = "", Optional schemeName As String = "AzureAd", Optional logger As ILogger = Nothing) As AuthenticationBuilder

Parameters

builder
AuthenticationBuilder

The existing authentication builder.

clientId
String

The application (client) ID for token validation.

tenantId
String

The Azure AD tenant ID. Can be empty for multi-tenant scenarios.

schemeName
String

The authentication scheme name.

logger
ILogger

Optional logger instance for logging. If null, a NullLogger will be used.

Returns

The AuthenticationBuilder for chaining.

Applies to

AddBotAuthentication(IServiceCollection, String, String, String, ILogger)

Adds JWT authentication for bots and agents with manually provided configuration values.

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBotAuthentication(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string clientId, string tenantId = "", string schemeName = "AzureAd", Microsoft.Extensions.Logging.ILogger? logger = default);
static member AddBotAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * string * Microsoft.Extensions.Logging.ILogger -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddBotAuthentication (services As IServiceCollection, clientId As String, Optional tenantId As String = "", Optional schemeName As String = "AzureAd", Optional logger As ILogger = Nothing) As AuthenticationBuilder

Parameters

services
IServiceCollection

The service collection to add authentication to.

clientId
String

The application (client) ID for token validation.

tenantId
String

The Azure AD tenant ID. Can be empty for multi-tenant scenarios.

schemeName
String

The authentication scheme name. Defaults to "AzureAd".

logger
ILogger

Optional logger instance for logging. If null, a NullLogger will be used.

Returns

An AuthenticationBuilder for further authentication configuration.

Applies to