public interface IGoogleAuthProvider
Provides access to Google auth credentials and scopes.
Namespace
Google.Apis.Auth.AspNetCore3Assembly
Google.Apis.Auth.AspNetCore3.dll
Methods
GetCredentialAsync(Nullable<TimeSpan>, CancellationToken)
Task<GoogleCredential> GetCredentialAsync(TimeSpan? accessTokenRefreshWindow = null, CancellationToken cancellationToken = default(CancellationToken))
Get a GoogleCredential for the current user. This is a short-term non-refreshable credential; do not store it for later use.
Parameters | |
---|---|
Name | Description |
accessTokenRefreshWindow | Nullable<TimeSpan> Optional. The duration that must be remaining on the oauth access token. If not specified then will use the default of 5 minutes. |
cancellationToken | CancellationToken Optional. Token to allow cancellation. |
Returns | |
---|---|
Type | Description |
Task<GoogleCredential> |
GetCurrentScopesAsync()
Task<IReadOnlyList<string>> GetCurrentScopesAsync()
Get the currently authorized Google scopes.
Returns | |
---|---|
Type | Description |
Task<IReadOnlyList<String>> | A list of all currently authorized Google scopes. |
RequireScopesAsync(String[])
Task<IActionResult> RequireScopesAsync(params string[] scopes)
Get a suitable auth challenge if any of the requested scopes are not yet authorized.
Parameter | |
---|---|
Name | Description |
scopes | String[] The required scopes. |
Returns | |
---|---|
Type | Description |
Task<IActionResult> | An auth challenge if any of the requested scopes are not yet authorized; a Task with a result of null otherwise. |