12 lines
392 B
C#
12 lines
392 B
C#
using System.Net.Http.Headers;
|
|
|
|
namespace OpenHarbor.JwtTokenManager.Abstractions;
|
|
|
|
public static class HttpClientExtensions
|
|
{
|
|
public static HttpClient SetJwtAccessToken(this HttpClient httpClient, JwtTokenManagerResult token)
|
|
{
|
|
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(token.TokenType.ToString(), token.AccessToken);
|
|
return httpClient;
|
|
}
|
|
} |