Google Connector - OAuth 2.0
Overview
Using Google OAuth 2.0, this module helps in generating access tokens and refresh tokens with Client ID and Client Secret.
- Access Token - It can be used with any of the Google APIs, such as the Google Drive API.
- Refresh Token - Once the access token has expired, it will be used to generate a new one.
Documentation
Google OAuth 2.0
Using Google OAuth 2.0, this module helps in generating access tokens and refresh tokens with Client ID and Client Secret.
• Access Token - It can be used with any of the Google APIs, such as the Google Drive API.
• Refresh Token - Once the access token has expired, it will be used to generate a new one.
Dependencies
• Mendix modeler 9.12.4.
• Encryption module
• Community Commons Module
• Nanoflow Commons Module
Configuration
Setup Client ID and Client Secret in Google
https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid
Configure ‘GoogleOAuthSettings_Overview’ to your Navigation.
Generate Token:
Add the following information in ‘GoogleOAuthSettings_Overview’ page new button
- OAuth Name
- Client ID
- Client Secret
- Scope
Save your configuration and click on ‘Generate Token’ button to generate the token using OAuth2.0 Authorization.
The access token and refresh token will be obtained, encrypted, and stored once the authorization has been successful. When the access token expires, the scheduler "SCE RefreshToken" will automatically generate a fresh token.
Refresh Token Manually:
To Refresh the token manually, the user can click on Edit button in ‘GoogleOAuthSettings_Overview’ where the below details can be seen.
-
OAuth Name
-
Client ID
-
Client Secret
-
Scope
-
Access Token
-
Refresh Token
-
Token Expire Date&Time
To regenerate the Access token, click ‘Refresh token’.
Revoke Access:
If the Google OAuth access needs to be revoked for the configured OAuth Setting, click on ‘Revoke Access’ button to revoke the OAuth access. The access token and refresh token should be regenerated using the ‘Generate Token’ button after the OAuth access has been revoked.
Reference:
https://developers.google.com/identity/protocols/oauth2/web-server