microsoft/healthcare-shared-components

Public

mirrored from https://github.com/microsoft/healthcare-shared-componentsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
main

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Microsoft.Health.Api/Features/Context/RequestContextAfterAuthenticationMiddlewareExtensions.cs

22lines · modecode

1// -------------------------------------------------------------------------------------------------
2// Copyright (c) Microsoft Corporation. All rights reserved.
3// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
4// -------------------------------------------------------------------------------------------------
5
6using EnsureThat;
7using Microsoft.AspNetCore.Builder;
8using Microsoft.Health.Core.Features.Context;
9
10namespace Microsoft.Health.Api.Features.Context;
11
12public static class RequestContextAfterAuthenticationMiddlewareExtensions
13{
14 public static IApplicationBuilder UseRequestContextAfterAuthentication<T>(
15 this IApplicationBuilder builder)
16 where T : IRequestContext
17 {
18 EnsureArg.IsNotNull(builder, nameof(builder));
19
20 return builder.UseMiddleware<RequestContextAfterAuthenticationMiddleware<T>>();
21 }
22}
23