共用方式為


SignalRFunctionsHostBuilderExtensions.AddDefaultAuth Method

Definition

Adds security token validation parameters' configuration and SignalR connection's configuration.

public static Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder AddDefaultAuth (this Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder builder, Action<Microsoft.IdentityModel.Tokens.TokenValidationParameters> configureTokenValidationParameters, Func<Microsoft.Azure.WebJobs.Extensions.SignalRService.SecurityTokenResult,Microsoft.AspNetCore.Http.HttpRequest,Microsoft.Azure.WebJobs.Extensions.SignalRService.SignalRConnectionDetail,Microsoft.Azure.WebJobs.Extensions.SignalRService.SignalRConnectionDetail> configurer = default);
static member AddDefaultAuth : Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder * Action<Microsoft.IdentityModel.Tokens.TokenValidationParameters> * Func<Microsoft.Azure.WebJobs.Extensions.SignalRService.SecurityTokenResult, Microsoft.AspNetCore.Http.HttpRequest, Microsoft.Azure.WebJobs.Extensions.SignalRService.SignalRConnectionDetail, Microsoft.Azure.WebJobs.Extensions.SignalRService.SignalRConnectionDetail> -> Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder
<Extension()>
Public Function AddDefaultAuth (builder As IFunctionsHostBuilder, configureTokenValidationParameters As Action(Of TokenValidationParameters), Optional configurer As Func(Of SecurityTokenResult, HttpRequest, SignalRConnectionDetail, SignalRConnectionDetail) = Nothing) As IFunctionsHostBuilder

Parameters

builder
Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder

Azure function host builder

configureTokenValidationParameters
Action<TokenValidationParameters>

Token validation parameters to validate security token

configurer
Func<SecurityTokenResult,HttpRequest,SignalRConnectionDetail,SignalRConnectionDetail>

SignalR connection configuration to be used in generating Azure SignalR service's access token

Returns

Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder

Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilderAzure function host builder

Applies to