Class IvOAuthTokenUtil
OAuth authentication utility class.
Inheritance
System.Object
IvOAuthTokenUtil
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ImageVault.Client.Authentication
Assembly: ImageVault.Client.dll
Syntax
public class IvOAuthTokenUtil : IAuthTokenUtil
Constructors
IvOAuthTokenUtil(ClientConfigurationSection, String, IList<String>, IList<Claim>)
Initializes a new instance of the IvOAuthTokenUtil class.
Declaration
public IvOAuthTokenUtil(ClientConfigurationSection clientConfiguration, string actAsUser = null, IList<string> roles = null, IList<Claim> claims = null)
Parameters
Type | Name | Description |
---|---|---|
ClientConfigurationSection | clientConfiguration | |
System.String | actAsUser | |
System.Collections.Generic.IList<System.String> | roles | |
System.Collections.Generic.IList<System.Security.Claims.Claim> | claims |
Properties
ClientConfiguration
Get/Sets the Configuration of the IvOAuthTokenUtil
Declaration
public ClientConfigurationSection ClientConfiguration { get; }
Property Value
Type | Description |
---|---|
ClientConfigurationSection |
TokenExpires
Gets the TokenExpires of the IvOAuthTokenUtil
Declaration
public DateTime TokenExpires { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Methods
ClearAuthToken()
Clears the current auth token
Declaration
public void ClearAuthToken()
GetAuthToken()
Gets the Authentication token that should be added to the Authorization header
Declaration
public string GetAuthToken()
Returns
Type | Description |
---|---|
System.String |
GetAuthToken(Boolean)
Gets the Authentication token that should be added to the Authorization header
Declaration
public string GetAuthToken(bool forceRenew)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | forceRenew |
Returns
Type | Description |
---|---|
System.String |
RequestAccessToken()
Requests an access token
Declaration
public AccessToken RequestAccessToken()
Returns
Type | Description |
---|---|
AccessToken |
Exceptions
Type | Condition |
---|---|
System.ApplicationException | If cannot create request for . |
ImageVaultException | If no configured SdkIdentity was found or if request access token failed: or if cannot get response stream from response or if unable to request access token @ . |