Class DanglIdentityAppTokenHandler
This handle is used to authenticate against apps that use the Dangl.Identity.Client.Mvc library. This means the servers do themselves provide a username / password login functionality but do delegate this internally to Dangl.Identity.
Inheritance
Implements
Inherited Members
Namespace: Dangl.Identity.Client.App
Assembly: Dangl.Identity.Client.App.dll
Syntax
public class DanglIdentityAppTokenHandler : ITokenHandler
Constructors
| Improve this Doc View SourceDanglIdentityAppTokenHandler(String, ITokenStorage, String, String, HttpClient)
This handle is used to authenticate against apps that use the Dangl.Identity.Client.Mvc library. This means the servers do themselves provide a username / password login functionality but do delegate this internally to Dangl.Identity.
Declaration
public DanglIdentityAppTokenHandler(string baseUrl, ITokenStorage tokenStorage, string userIdentifier = null, string userPassword = null, HttpClient httpClient = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | baseUrl | |
Dangl.RestClient.ITokenStorage | tokenStorage | |
System.String | userIdentifier | |
System.String | userPassword | |
System.Net.Http.HttpClient | httpClient |
Properties
| Improve this Doc View SourceCanGetToken
This returns true if the instance was instantiated with both an user identifier and a password. A new token can be obtained if both user identifier and password are known.
Declaration
public bool CanGetToken { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanRefreshToken
This always returns true
Declaration
public bool CanRefreshToken { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceGetAndStoreTokenAsync()
This will perform a login with user identifier and password via the Dangl.Identity.Client.Mvc controller
Declaration
public async Task<OAuthToken> GetAndStoreTokenAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Dangl.RestClient.OAuthToken> |
RefreshAndStoreTokenAsync()
This will try to refresh the token via the Dangl.Identity.Client.Mvc controller on the target server.
Declaration
public async Task<OAuthToken> RefreshAndStoreTokenAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Dangl.RestClient.OAuthToken> |
SetUserCredentials(String, String)
This method can be used
Declaration
public void SetUserCredentials(string userIdentifier, string userPassword)
Parameters
Type | Name | Description |
---|---|---|
System.String | userIdentifier | |
System.String | userPassword |
Events
| Improve this Doc View SourceTokenUpdate
This event is raised when a token is refreshed or obtained
Declaration
public event EventHandler<TokenUpdateEventArgs> TokenUpdate
Event Type
Type | Description |
---|---|
System.EventHandler<Dangl.RestClient.TokenUpdateEventArgs> |