This article explains how to incorporate Google Sign-in into your web application. Google Sign-in enables your users to sign-in to your website using their existing Google accounts, the same ones they have been using with Gmail, Google Play, and many other Google services.

Registering Your Web Application in Google Developers Console

As Google needs to be able to identify your application when it’s requesting authorization to access Google accounts, you’d need to first register a new application with Google.

  1. Navigate to Google Developers Console
    Open your browser and navigate to the Google Developers Console.
    You will be asked to login using a Google account. You can use any of your Google accounts, but it’s best to use a Google account that you specifically designate for this purpose (ask your Administrator to create one if required), so it can easily be transferred to another person in your organisation if the needs arise.
    If you were not asked to sign-in, it means that you are already signed-in with a Google account. Confirm that this is the account you really want to use when registering your web applications. If it’s not the one, sign out and sign back in using the right account.
  2. Create a New Project

  3. Set Application Display Name in Consent Screen

    Scroll to the end and click Save
  4. Create Client ID and Client Secret

    If you are configuring this to run the Login Form sample app (from the Integration Library package), enter the following value (assuming you are running local LANSA web on port 80, on partition DEM):
    For your production applications, you will need to enter the actual domain name of your web application (e.g. Google also requires that you use HTTPS (localhost however is exempted from the requirement, so you can use http://localhost).
    Keep in mind that the redirect URI registered here must match exactly with what’s provided to Google login form, and it’s also case-sensitive.

  5. Copy the new Client ID and Client Secret to Clipboard

Configuring Integration Library with the New Client ID and Client Secret

Launch the Integration Library configuration tool from the Package Manager. See the Configuring the Integration Library section in this guide for more details.
Navigate to the OAuth2 then Google

Paste the client ID and client secret you copied in the previous section.
You have completed the configuration to support Google Sign-in in your web application.