RouteBuilderBase<TBuilder>.WithOAuthHandlers 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
| Name | Description |
|---|---|
| WithOAuthHandlers(Func<ITurnContext,String[]>) |
Configures OAuth handler functions for the route using the specified delegate. |
| WithOAuthHandlers(String) |
Configures the builder to use one or more OAuth authentication handlers specified in a delimited string. |
| WithOAuthHandlers(String[]) |
Configures the route to use the specified OAuth authentication handlers. |
WithOAuthHandlers(Func<ITurnContext,String[]>)
Configures OAuth handler functions for the route using the specified delegate.
public TBuilder WithOAuthHandlers(Func<Microsoft.Agents.Builder.ITurnContext,string[]> handlers);
member this.WithOAuthHandlers : Func<Microsoft.Agents.Builder.ITurnContext, string[]> -> 'Builder
Public Function WithOAuthHandlers (handlers As Func(Of ITurnContext, String())) As TBuilder
Parameters
- handlers
- Func<ITurnContext,String[]>
A delegate that takes an ITurnContext and returns an array of OAuth handler names to be used
for authentication. If handlers is null, no OAuth handlers will be configured.
Returns
The current RouteBuilder instance with the OAuth handlers configured.
Remarks
Use this method to specify custom OAuth authentication handlers for the route. The provided delegate will be invoked for each request to determine which handlers should be applied based on the context.
Applies to
WithOAuthHandlers(String)
Configures the builder to use one or more OAuth authentication handlers specified in a delimited string.
public TBuilder WithOAuthHandlers(string delimitedHandlers);
member this.WithOAuthHandlers : string -> 'Builder
Public Function WithOAuthHandlers (delimitedHandlers As String) As TBuilder
Parameters
- delimitedHandlers
- String
A string containing the names of OAuth handlers, separated by commas, spaces, or semicolons. Can be null or empty to indicate no handlers.
Returns
The builder instance configured with the specified OAuth handlers.
Remarks
Handler names are parsed from the input string using comma, space, or semicolon delimiters. This method is useful for enabling multiple OAuth providers in a single call.
Applies to
WithOAuthHandlers(String[])
Configures the route to use the specified OAuth authentication handlers.
public TBuilder WithOAuthHandlers(string[] handlers);
member this.WithOAuthHandlers : string[] -> 'Builder
Public Function WithOAuthHandlers (handlers As String()) As TBuilder
Parameters
- handlers
- String[]
An array of handler names to be used for OAuth authentication. If null, no handlers will be configured.
Returns
The current RouteBuilder instance with the OAuth handlers configured.
Remarks
Use this method to specify which OAuth authentication handlers should be applied to the route. This is useful when multiple authentication schemes are available and you want to restrict the route to specific handlers.