public interface IGoogleAuthProviderProvides access to Google auth credentials and scopes.
Namespace
Google.Apis.Auth.AspNetCore3Assembly
Google.Apis.Auth.AspNetCore3.dll
Methods
GetCredentialAsync(TimeSpan?, CancellationToken)
Task<GoogleCredential> GetCredentialAsync(TimeSpan? accessTokenRefreshWindow = null, CancellationToken cancellationToken = default)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 |
TimeSpanOptional. The duration that must be remaining on the oauth access token. If not specified then will use the default of 5 minutes. |
cancellationToken |
CancellationTokenOptional. Token to allow cancellation. |
| Returns | |
|---|---|
| Type | Description |
TaskGoogleCredential |
|
GetCurrentScopesAsync()
Task<IReadOnlyList<string>> GetCurrentScopesAsync()Get the currently authorized Google scopes.
| Returns | |
|---|---|
| Type | Description |
TaskIReadOnlyListstring |
A list of all currently authorized Google scopes. |
RequireScopesAsync(params 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 |
stringThe required scopes. |
| Returns | |
|---|---|
| Type | Description |
TaskMicrosoft.AspNetCore.Mvc.IActionResult |
An auth challenge if any of the requested scopes are not yet authorized; a Task with a result of null otherwise. |