Class PasswordHttpClient
The implementation of an access token service for client credentials based on IdentityServer4.
Inheritance
Implements
Inherited Members
Namespace: Geko.HttpClientService.Infrastructure
Assembly: Geko.HttpClientService.dll
Syntax
public class PasswordHttpClient : IIdentityServerHttpClient
Constructors
| Improve this Doc View SourcePasswordHttpClient(HttpClient)
Constructor of the ClientCredentialsHttpClient.
Declaration
public PasswordHttpClient(HttpClient httpClient)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | httpClient | An |
Properties
| Improve this Doc View SourceHttpClientOptionsType
The type of the IIdentityServerOptions implementation that this HttpClient needs
Declaration
public Type HttpClientOptionsType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Improve this Doc View SourceGetCacheKey(IIdentityServerOptions)
Creates a unique key to be used as the cache key of the Identity Server access token, by combining infomration from the access token options object. See Geko.HttpClientService.Models.PasswordOptions for the access token options.
Declaration
public string GetCacheKey(IIdentityServerOptions options)
Parameters
Type | Name | Description |
---|---|---|
IIdentityServerOptions | options | The token service options |
Returns
Type | Description |
---|---|
System.String | Returns a string representing a unique identifier to be used as the caching key, by getting the hashcode of the address, the client, the username and the scopes. |
GetTokenResponseAsync(IIdentityServerOptions)
Retrieves a IdentityModel.Client.TokenResponse from the configured by the options
.
Declaration
public async Task<TokenResponse> GetTokenResponseAsync(IIdentityServerOptions options)
Parameters
Type | Name | Description |
---|---|---|
IIdentityServerOptions | options | The Geko.HttpClientService.Models.PasswordOptions for the IdentityServer4. |
Returns
Type | Description |
---|---|
Task<IdentityModel.Client.TokenResponse> | A IdentityModel.Client.TokenResponse object. |