providers/google library

This library contains the Google authentication provider for the Serverpod Idp module.

Classes

AuthSuccess
Response model representing a successful authentication result with all relevant authentication information.
GoogleAccount
A fully configured Google account to be used for logins.
GoogleClientSecret
Contains information about the credentials for the server to access Google's APIs. The secrets are typically loaded from config/google_client_secret.json. The file can be downloaded from Google's cloud console.
GoogleIdp
Main class for the Google identity provider. The methods defined here are intended to be called from an endpoint.
GoogleIdpAdmin
Collection of Google-account admin methods.
GoogleIdpBaseEndpoint
Base endpoint for Google Account-based authentication.
GoogleIdpConfig
Configuration for the Google identity provider.
GoogleIdpConfigFromPasswords
Creates a new GoogleIdpConfig from keys on the passwords.yaml file.
GoogleIdpUtils
Utility functions for the Google identity provider.

Extensions

GoogleIdpGetter on AuthServices
Extension to get the GoogleIdp instance from the AuthServices.

Typedefs

GetExtraGoogleInfoCallback = Future<void> Function(Session session, {required String accessToken, required GoogleAccountDetails accountDetails, required Transaction? transaction})
Function to be called to extract additional information from Google APIs using the access token. The session and transaction can be used to store additional information in the database.
GoogleAccountDetails = ({String email, String? fullName, Uri? image, String? name, String userIdentifier, bool? verifiedEmail})
Details of the Google Account.
GoogleAccountDetailsValidation = void Function(GoogleAccountDetails accountDetails)
Function to be called to check whether a Google account details match the requirements during registration.
GoogleAuthSuccess = ({UuidValue authUserId, GoogleAccountDetails details, UuidValue googleAccountId, bool newAccount, Set<Scope> scopes})
Result of a successful authentication using Google as identity provider.

Exceptions / Errors

GoogleIdTokenVerificationException
Exception to be thrown if the Google ID token verification fails.
GoogleUserInfoMissingDataException
Exception thrown when the user info from Google is missing required data.