Mar 07

Custom Security using Google OAuth Prefab

In this section we will be seeing how to validate Google Login using Custom Security within WaveMaker App and to access Gmail API. Steps to attain this include:

  1. Using OAuth Prefab for Google to get the access token for the Google user to access Google API – Gmail API
  2. To validate the login through Google, a Java Service will be created which will override WMCustomAuthenticationManager
  3. The access token from OAuth prefab will be used as an id in the WMUser object returned by the Java Service.

We have used the following Java code to accomplish this.

  • Dependency in pom.xml file
  • Imports of Java Service – class definition:
  • Java Class – Method Definition :
  • On Load JavaScript for Google Prefab

We use cookies to provide you with a better experience. By using our website you agree to the use of cookies as described in our Privacy Policy.