OAuth 2.0 is an authorization framework, which is updated after the original OAuth protocol created in 2006. OAuth 2.0 is a standard protocol, which provides delegated secured access for web, mobile, and desktop applications. To know more about the working of WaveMaker OAuth Prefabs click here.
Google OAuth in WaveMaker
In order to use the Google OAuth prefab, please follow the below steps:
Disclaimer: The screenshots from the Google website were current at the time of writing this document, the actual screens might differ.
- Log on to https://console.developers.google.com and enter your credentials. Google Developers Console window is displayed.
- On the left of the Google Developers Console screen click Create Project. New Project window is displayed. Enter the Project name in its respective field. Note: Project ID is displayed by default. Check the Terms of Service checkbox and click Create. Your project is successfully created.
- In the left panel of the project screen select Credentials from APIs & auth section.
- Click Create new Client ID. Create Client ID window is displayed.
- Select the Application type to be a Web application and click Configure consent screen. Consent screen page is displayed.
Here we show a simple use case for login using Google credentials. For validation using custom security to access Gmail API see here.
Create an application using WaveMaker. Drag and Drop the Google OAuth PreFab onto the canvas. You can use the default login page created by WaveMaker.
You can set the Login Mode to be:
- auto will in the run mode after initialization of the Prefab the app would automatically be navigated to the OAuth Authorization page
- manual (default mode) will invoke the OAuth Authorization page on click of the login button
Save the application and Run the application. Note the redirect URL.
Go to Google Developers Console – your project page and click on Edit Settings. Enter this redirect Url in the Authorized redirect URIs field and click Update.
Go back to WaveMaker application and again Run the app. You can now see the application. You will see the WaveMaker login screen if you have set the Login Mode as manual: Click the Login with Google button and you will be directed to the Google login page. This will be the first screen in case you have set the Login Mode to auto:
Entering the Google credential will allow access to the WaveMaker App