auth_io library Null safety

Classes

AccessCredentials
OAuth2 Credentials.
AccessToken
An OAuth2 access token.
AuthClient
A authenticated HTTP client.
AutoRefreshingAuthClient
A auto-refreshing, authenticated HTTP client.
ClientId
Represents the client application's credentials.
ServiceAccountCredentials
Represents credentials for a service account.

Functions

authenticatedClient(Client baseClient, AccessCredentials credentials) AuthClient
Obtain an http.Client which automatically authenticates requests using credentials. [...]
autoRefreshingClient(ClientId clientId, AccessCredentials credentials, Client baseClient) AutoRefreshingAuthClient
Obtain an http.Client which automatically refreshes credentials before they expire. Uses baseClient as a base for making authenticated http requests and for refreshing credentials. [...]
clientViaApiKey(String apiKey, {Client? baseClient}) Client
Obtains a HTTP client which uses the given apiKey for making HTTP requests. [...]
clientViaApplicationDefaultCredentials({required List<String> scopes, Client? baseClient}) Future<AutoRefreshingAuthClient>
Create a client using Application Default Credentials. [...]
clientViaMetadataServer({Client? baseClient}) Future<AutoRefreshingAuthClient>
Obtains oauth2 credentials and returns an authenticated HTTP client. [...]
clientViaServiceAccount(ServiceAccountCredentials clientCredentials, List<String> scopes, {Client? baseClient}) Future<AutoRefreshingAuthClient>
Obtains oauth2 credentials and returns an authenticated HTTP client. [...]
clientViaUserConsent(ClientId clientId, List<String> scopes, PromptUserForConsent userPrompt, {Client? baseClient}) Future<AutoRefreshingAuthClient>
Obtains oauth2 credentials and returns an authenticated HTTP client. [...]
clientViaUserConsentManual(ClientId clientId, List<String> scopes, PromptUserForConsentManual userPrompt, {Client? baseClient}) Future<AutoRefreshingAuthClient>
Obtains oauth2 credentials and returns an authenticated HTTP client. [...]
obtainAccessCredentialsViaCodeExchange(Client baseClient, ClientId clientId, String code, {String redirectUrl = 'postmessage'}) Future<AccessCredentials>
Obtain oauth2 AccessCredentials by exchanging an authorization code. [...]
obtainAccessCredentialsViaMetadataServer(Client baseClient) Future<AccessCredentials>
Obtain oauth2 AccessCredentials using the metadata API on ComputeEngine. [...]
obtainAccessCredentialsViaServiceAccount(ServiceAccountCredentials clientCredentials, List<String> scopes, Client baseClient) Future<AccessCredentials>
Obtain oauth2 AccessCredentials using service account credentials. [...]
obtainAccessCredentialsViaUserConsent(ClientId clientId, List<String> scopes, Client client, PromptUserForConsent userPrompt) Future<AccessCredentials>
Obtain oauth2 AccessCredentials using the oauth2 authentication code flow. [...]
obtainAccessCredentialsViaUserConsentManual(ClientId clientId, List<String> scopes, Client client, PromptUserForConsentManual userPrompt) Future<AccessCredentials>
Obtain oauth2 AccessCredentials using the oauth2 authentication code flow. [...]
refreshCredentials(ClientId clientId, AccessCredentials credentials, Client client) Future<AccessCredentials>
Tries to obtain refreshed AccessCredentials based on credentials using client.

Enums

ResponseType
Available response types that can be requested when using the implicit browser login flow. [...]

Typedefs

PromptUserForConsent(String uri) → void
Function for directing the user or it's user-agent to uri. [...]
PromptUserForConsentManual(String uri) Future<String>
Function for directing the user or it's user-agent to uri. [...]

Exceptions / Errors

AccessDeniedException
Thrown if an attempt to make an authorized request failed.
RefreshFailedException
Thrown if an attempt to refresh a token failed.
UserConsentException
Thrown if user did not give his consent.