[Google Login Plugin] Using Google Login Plugin

[Google Login Plugin] Using Google Login Plugin

  
Forge Component
(6)
Published on 6 Jul by OutSystems Labs
6 votes
Published on 6 Jul by OutSystems Labs

Usage Instructions


To use this plugin in your application you’ll need to reference the following actions:

  • GoogleLogin (Google Login Plugin)

  • ValidateAndLoginGoogleUser (Google Core)

 

Old vs New GoogleLogin action

Old

New

 

 

Input parameters mapping between old and new

  • isSilent = IsSilent

  • mapUser = IsMapUsers

  • scopes = Scopes

  • webApiKey = ClientId

  • offline = Offline

 

New parameters

  • ForceApprovalPrompt (Forces the permission popup to appear in each login) Default value: False 

  • OneToOneEmailMapping = To the value in the old site property OneToOneEmailMapping’ (ensures that the given email only match one user on the server database) Default value: False

  • CreateGoogleUsers = To the value in the old site property ‘CreateGoogleUsers’ (ensures that the plugin can create a server user to match the given email if no user is found) Default value: False

 

Changes to actions

  • The old Google Login action did all the work of validating the google credentials and then if configured to do so, it would login the user on the OS Platform.

  • The new Google Login action still does the validating the google credentials. After that it uses the new Google Core action to store the user data  and if configured to do so create or retrieve a matched user to the given email on the server side. However, it does not login the user on the OS Platform.

If you need to login the user on the OS Platform you should use Google Core’s ‘ValidateAndLoginGoogleUser’ action.

 

Examples

Here is a practical implementation:



LoginOS action logic: 

Do not forget that the needed extensibility configurations now reside on the application instead of the plugin.

 

{

    "plugin":

        {

            "url": "https://github.com/EddyVerbruggen/cordova-plugin-googleplus#5.0.3",

            "variables": [{

                "name": "REVERSED_CLIENT_ID",

                "value": "{iOS URL scheme}"

            }]

        }

}