Skip to main content

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken”></a> Class AuthorizationAccessToken

Namespace: SuperOffice.WebApi.Authorization
Assembly: SuperOffice.WebApi.Authorization.AccessToken.dll
OAuth 2.0 access token (and refresh token) <xref href=“SuperOffice.WebApi.Authorization.IAuthorization” data-throw-if-not-resolved=“false”></xref>. With a refresh token, AppToken and AppSecret defined we can automatically refresh access token on expiry.

Inheritance

objectAuthorizationAccessToken

Implements

IAuthorization

Inherited Members

object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Constructors

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken__ctor_System_String_”></a> AuthorizationAccessToken(string)

AccessTokenAuthorization Constructor. Using this constructor will not renew an access token when it has expired.

Parameters

accessToken string An OAuth 2.0 access_token.

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken__ctor_System_String_System_String_System_String_System_String_System_String_System_String_”></a> AuthorizationAccessToken(string, string, string, string, string, string)

AccessTokenAuthorization Constructor. This will attempt to renew the access token when it has expired.

Parameters

accessToken string An OAuth 2.0 access_token. refreshToken string Refresh token that can be used to get a new access token. clientId string Client identifier, equal to OAuth client_id. clientSecret string CLient Secret, equal to Oauth client_secret. This is required for WebApps, but not for Native/Mobile apps. redirectUrl string Redirect URL registered to your app subdomain string Determines CRM online subdomain, i.e. sod, qastage or online.

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken__ctor_System_String_System_String_System_String_System_String_System_String_”></a> AuthorizationAccessToken(string, string, string, string, string)

AccessTokenAuthorization Constructor. This will attempt to renew the access token when it has expired for Native/Mobile apps, which don’t require a ClientSecret.

Parameters

accessToken string An OAuth 2.0 access_token. refreshToken string Refresh token that can be used to get a new access token. clientId string Client identifier, equal to OAuth client_id. redirectUrl string Redirect URL registered to your app subdomain string Determines CRM online subdomain, i.e. sod, qastage or online.

Properties

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_AccessToken”></a> AccessToken

OAuth access_token value.

Property Value

string

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_ClientId”></a> ClientId

OAuth client_id value.

Property Value

string

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_ClientSecret”></a> ClientSecret

OAuth client_secret value.

Property Value

string

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_IdToken”></a> IdToken

OAuth id_token value.

Property Value

string

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_RedirectUrl”></a> RedirectUrl

OAuth redirect_uri value.

Property Value

string

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_RefreshAuthorizationAsync”></a> RefreshAuthorizationAsync

Try to refresh this <xref href=“SuperOffice.WebApi.Authorization.IAuthorization” data-throw-if-not-resolved=“false”></xref> instance.

Property Value

Func<ReAuthorizationArgs, Task<IAuthorization&gt;&gt;

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_RefreshToken”></a> RefreshToken

OAuth refresh_token value.

Property Value

string

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_SubDomain”></a> SubDomain

SuperOffice CRM Online subdomain; SOD, Stage, Production.

Property Value

string

Methods

<a id=“SuperOffice_WebApi_Authorization_AuthorizationAccessToken_GetAuthorization”></a> GetAuthorization()

Gets a tuple that represents authorization scheme and parameter.

Returns

AuthenticationHeaderValue Gets a <xref href=“System.Tuple%602” data-throw-if-not-resolved=“false”></xref> (string,string) where scheme is Bearer and parameter is the access token.