Class UserInformationTransmissionHttpHandler
This http handler is used in service-to-service communications. It should only be used when communicating with services using Dangl.Identity. It will send the user id, username and email as Http headers. The client must have special permissions granted so that receivers will accept these values. See the README for details.
Inheritance
Implements
Inherited Members
Namespace: Dangl.Identity.Client.Mvc.Services
Assembly: Dangl.Identity.Client.Mvc.dll
Syntax
public class UserInformationTransmissionHttpHandler : DelegatingHandler, IDisposable
Constructors
| Improve this Doc View SourceUserInformationTransmissionHttpHandler(IEnumerable<String>, IUserInfoService)
This http handler is used in service-to-service communications. It should only be used when communicating with services using Dangl.Identity. It will send the user id, username and email as Http headers. The client must have special permissions granted so that receivers will accept these values. See the README for details.
Declaration
public UserInformationTransmissionHttpHandler(IEnumerable<string> baseUrls, IUserInfoService userInfoService)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | baseUrls | |
IUserInfoService | userInfoService |
UserInformationTransmissionHttpHandler(IEnumerable<String>, IHttpContextAccessor)
This constructor takes an Microsoft.AspNetCore.Http.IHttpContextAccessor to resolve the required IUserInfoService per-request. This should be used in combination with long-lifed objects, for example when using the HttpClientFactory where a single instance of the delegate is kept alive for multiple requests.
Declaration
public UserInformationTransmissionHttpHandler(IEnumerable<string> baseUrls, IHttpContextAccessor httpContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | baseUrls | |
Microsoft.AspNetCore.Http.IHttpContextAccessor | httpContextAccessor |
Methods
| Improve this Doc View SourceSendAsync(HttpRequestMessage, CancellationToken)
Will append the headers if the request url is absolute and is in the list of allowed base urls
Declaration
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.HttpRequestMessage | request | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> |