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.OAuth2
Assembly: Google.Apis.Auth.dll
Syntax
public interface ITokenAccess
Methods
GetAccessTokenForRequestAsync(String, 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.
Declaration
Task<string> GetAccessTokenForRequestAsync(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<System.String> | The access token. |