UserInfoContextMiddlewareExtensions.UseUserInfoContext 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.
Adds the user info context middleware to the application pipeline.
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseUserInfoContext(this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Func<Microsoft.AspNetCore.Http.HttpContext,System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Tools.Models.UserInfo?>>? userResolver = default);
static member UseUserInfoContext : Microsoft.AspNetCore.Builder.IApplicationBuilder * Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Tools.Models.UserInfo>> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseUserInfoContext (app As IApplicationBuilder, Optional userResolver As Func(Of HttpContext, Task(Of UserInfo)) = Nothing) As IApplicationBuilder
Parameters
The application builder.
- userResolver
- Func<HttpContext,Task<UserInfo>>
Optional custom user resolver function. If not provided, uses the default header-based resolver.
Returns
The application builder for chaining.