Adds support for GoogleAPI - OAuth2 and Google service accounts
SendOauth2 V4.0.0 supports both OAuth2 and Basic authentication for both Microsoft 365 Exchange email and Google Gmail.
Microsoft support is for Microsoft 365 accounts using Graph V1 with the V2 authentication and authorization endpoints.
Google support is for any non-legacy version of Gmail.
Client secrets and X.509 certificates are supported for Microsoft.
TheLeague's Gmail provider only supports client secrets (and only for authorization_code grant).
Google's Gmail API supports client secrets for authorization_code grant and X.509 certificates for client_credentials grant (aka Google 'service accounts'), and both are supported by the wrapper. Google's use of .json credentials files is out of kilter with PHPMailer's established client authentication mechanism, so the wrapper creates these files automatically (although Google's own files can optionally be used instead)
For Microsoft, both authorization_code grant and client_credentials (i.e. application) grant flows for SMTP are supported.
For the Google API, both authorization_code grant and client_credentials (service accounts) grant for SMTP are supported (see github repository/library googleapis/google-api-php-client)
TheLeague's Google Gmail provider only supports authorization_code grant, and this is supported by the wrapper.
Where the provider or client supports them, both $_SESSION 'state' exchange and PKCE code exchange are implemented automatically by the wrapper to forestall CSRF attacks during authorization_code flow.
SendOauth2 can provide automatic renewal of refresh tokens for Microsoft 365; this is normally unnecessary for Gmail as Google refresh tokens do not life-expire by default.