Struct AuthorizationTokens
Represents a set of OAUTH 2.0 access and refresh authorization tokens.
Implements
Inherited Members
Namespace: UOL.SDK.Authorization
Assembly: UOL.SDK.dll
Syntax
public struct AuthorizationTokens : IEquatable<AuthorizationTokens>
Constructors
AuthorizationTokens(String)
Initializes a new instance of the AuthorizationTokens struct with only an access token.
Declaration
public AuthorizationTokens(string accessToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | accessToken | Specifies the access token retrieved from tan authorization server. |
AuthorizationTokens(String, DateTime, String)
Initializes a new instance of the AuthorizationTokens struct.
Declaration
public AuthorizationTokens(string accessToken, DateTime accessTokenExpirationDate, string refreshToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | accessToken | Specifies the access token retrieved from an authorization server. |
System.DateTime | accessTokenExpirationDate | Specifies the expiration date time of the access token. |
System.String | refreshToken | Specifies the refresh token retrieved from an authorization server. |
Fields
Empty
Initializes a new empty instance of AuthorizationTokens.
Declaration
public static readonly AuthorizationTokens Empty
Field Value
Type | Description |
---|---|
AuthorizationTokens |
Properties
AccessToken
Gets the access token.
Declaration
public string AccessToken { get; }
Property Value
Type | Description |
---|---|
System.String | The access token. |
AccessTokenExpirationDate
Gets the expiration date and time for the access token.
Declaration
public DateTime AccessTokenExpirationDate { get; }
Property Value
Type | Description |
---|---|
System.DateTime | The access token expiration date and time. |
RefreshToken
Gets the refresh token.
Declaration
public string RefreshToken { get; }
Property Value
Type | Description |
---|---|
System.String | The refresh token. |
Methods
Equals(Object)
Determines whether this instance and a specified object, which must also be a AuthorizationTokens object, have the same value, that is the same access and refresh tokens.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The AuthorizationTokens to compare to this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Equals(AuthorizationTokens)
Determines whether this instance and a specified object, which is also a AuthorizationTokens object, have the same value, that is the same access and refresh tokens.
Declaration
public bool Equals(AuthorizationTokens other)
Parameters
Type | Name | Description |
---|---|---|
AuthorizationTokens | other | The AuthorizationTokens to compare to this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetHashCode()
Returns the hash code for this AuthorizationTokens.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer hash code. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the current object. |
Overrides
Operators
Equality(AuthorizationTokens, AuthorizationTokens)
Determines whether two specified IAuthorizationService have the same value.
Declaration
public static bool operator ==(AuthorizationTokens left, AuthorizationTokens right)
Parameters
Type | Name | Description |
---|---|---|
AuthorizationTokens | left | One set of tokens. |
AuthorizationTokens | right | Another set of tokens |
Returns
Type | Description |
---|---|
System.Boolean |
|
Inequality(AuthorizationTokens, AuthorizationTokens)
Determines whether two specified AuthorizationTokens have different values.
Declaration
public static bool operator !=(AuthorizationTokens left, AuthorizationTokens right)
Parameters
Type | Name | Description |
---|---|---|
AuthorizationTokens | left | One set of tokens. |
AuthorizationTokens | right | Another set of tokens |
Returns
Type | Description |
---|---|
System.Boolean |
|