-
Notifications
You must be signed in to change notification settings - Fork 1
OAuth2Token
Represents a simple/base OAuth 2.0 token (bearer style token). Other types of token, such as MAC tokens, should derive from this class and provide additional properties for the extra values required. They should also override the SignRequest(HttpRequestMessage, OAuth2HttpRequestSigningMethod, string) method if neccesary, to correctly sign requests made with this token.
The access token value.
The type of token this class represents.
The life time in seconds of this token.
The calculated expiry date of the token. This value is based on the system clock. If the clients clock is incorrect, the calculated expiry will also be incorrect.
An optional refresh token used to renew the access token after it expires.
Sets or returns the date and time the token was created. This is automatically set to DateTime.Now by the constructor, but should be saved and reloaded along with the other properties if persisting the token between app sessions.
SignRequest(HttpRequestMessage request, OAuth2HttpRequestSigningMethod signingMethod, string tokenQueryKey)
Signs the specified HttpRequestMessage using this token. Unless overridden this method signs the request by setting providing the token value (and token type as the 'scheme' if signingMethod is OAuth2HttpRequestSigningMethod.AuthorizationHeader.