Interface ITokenAccessWithHeaders
Allows direct retrieval of access tokens to authenticate requests. The access tokens obtained can be accompanied by extra information that either describes the access token or is associated with it. This information should acompany the token as headers when the token is used to access a resource.
Inherited Members
Namespace: Google.Apis.Auth.OAuth2
Assembly: Google.Apis.Auth.dll
Syntax
public interface ITokenAccessWithHeaders : ITokenAccess
Methods
GetAccessTokenWithHeadersForRequestAsync(String, CancellationToken)
Gets an access token to authorize a request.
The token might be accompanied by extra information that should be sent
in the form of headers.
Implementations should handle automatic refreshes of the token
if they are supported.
The authUri
might be required by some credential types
(e.g. the JWT access token) while other credential types
migth just ignore it.
Declaration
Task<AccessTokenWithHeaders> GetAccessTokenWithHeadersForRequestAsync(string authUri = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | authUri | The URI the returned token will grant access to. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<AccessTokenWithHeaders> | The access token with headers if any. |