public interface ITokenAccess
Allows direct retrieval of access tokens to authenticate requests. This is necessary for workflows where you don't want to use BaseClientService to access the API. (e.g. gRPC that implemenents the entire HTTP2 stack internally).
Namespace
Google.Apis.Auth.OAuth2Assembly
Google.Apis.Auth.dll
Methods
GetAccessTokenForRequestAsync(String, CancellationToken)
Task<string> GetAccessTokenForRequestAsync(string authUri = null, CancellationToken cancellationToken = default(CancellationToken))
Gets an access token to authorize a request.
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.
Parameters | |
---|---|
Name | Description |
authUri | String The URI the returned token will grant access to. |
cancellationToken | CancellationToken The cancellation token. |
Returns | |
---|---|
Type | Description |
Task<String> | The access token. |