Skip to main content

<a id=“SuperOffice_WebApi_AuthorizationUserToken”></a> Class AuthorizationUserToken

Namespace: SuperOffice.WebApi
Assembly: SuperOffice.WebApi.dll
Username and password are used to get an access token from given username and password If the access token is invalidated, will try to authenticate with username and password to get a new access token. The current access token can be retrieved with <pre><code class=“lang-csharp”>var (_, accessToken) = authInstance.GetAuthorization();</code></pre>

Inheritance

objectAuthorizationUserToken

Implements

IAuthorization

Inherited Members

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

Remarks

If the access token is omitted on construction, the first agent call will result in three requests:
  1. The first agent call which will fail
  2. A call to UserAgent.GetCurrentToken with the username and passwor to obtain an access token
  3. The original agent call which should now succeed with the new access token

Constructors

<a id=“SuperOffice_WebApi_AuthorizationUserToken__ctor_System_String_System_String_System_String_”></a> AuthorizationUserToken(string, string, string)

Parameters

userName string Users name. password string Users password. accessToken string Optional access token. Should be a 8A: style bearer token, same as what UserAgent.GetCurrentToken will deliver

Properties

<a id=“SuperOffice_WebApi_AuthorizationUserToken_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;

Methods

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

Returns

AuthenticationHeaderValue