Unofficial Content

This document will explain what methods GAM provides to authenticate against External Identity Providers and also some methods to authenticate against GAM as an Identity Provider.

GAMRepository.Login() method:

This method executes Local Authentication Type.
&UserName     = !”Juan”     //&Username based on VarChar data type
&UserPassword = !”123” //&Password based on Character data type
&GAMLoginAdditionalParameters.AuthenticationTypeName = !”local” //&GAMLoginAdditionalParameters based on GAMLoginAdditionalParameters data type
&GAMErrorCollection // Based on GAMError collection data type.

GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection)

For more information about this Authentication Type, see the following document: GAM - Local Authentication Type

In case you are using Custom Authentication Type, the method used is the same:
&GAMLoginAdditionalParameters.AuthenticationTypeName = !"custom-authentication"
GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection )

For more information about Custom Authentication Type, see the following document: GAM - Custom Authentication Type

In turn, if you use One Time Password, the method used is the same:

&GAMLoginAdditionalParameters.AuthenticationTypeName = !"gam-otp-web"
&GAMLoginAdditionalParameters.OTPStep                = 1
GAMRepository.Login(&UserName, &UserPassword_nula, &GAMLoginAdditionalParameters, &GAMErrorCollection)

For more information about One Time Password Authentication Type, see the following document: GAM - One Time Password (OTP)

In case you are using GAMRemoteREST Authentication Type, the method used is:

&GAMLoginAdditionalParameters.AuthenticationTypeName = !"gamremote-rest"
GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection)

For more information aboutGAMRemoteREST Authentication Type, see the following document: GAMRemote REST Authentication Type

 

GAMRepository.LoginGAMRemote() method:

This method consists of authenticating to the GAM Identity Provider using Single Sign On (SSO).
In case you use this method and you have already defined more than one GAMRemote authentication type, GAM uses the first authentication type of that type, ordered alphabetically.

If you have more than one GAMRemote Authentication Type defined in your application, the method to use is:

&GAMLoginAdditionalParameters.AuthenticationTypeName =  "gam-remote-2"
GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection)

Mobile:

&LoginExternalAdditionalParameters = new()
&LoginExternalAdditionalParameters.Repository  = &GAMRepositoryGUID  //Use only when more than one Repository is defined in the Identity Provider (multi-tenant)
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.GAMRemote, &UserName, &UserPassword, &LoginExternalAdditionalParameters)
Or in case you have defined more than one:
&LoginExternalAdditionalParameters = new()
&LoginExternalAdditionalParameters.Repository  = &GAMRepositoryGUID  //Use only when more than one Repository is defined in the Identity Provider (multi-tenant)
&LoginExternalAdditionalParameters.AuthenticationTypeName  = !"idp_name" //Use only when more than one GAMRemote authentication type is defined
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.GAMRemote, &UserName, &UserPassword, &LoginExternalAdditionalParameters)

For more information about GAMRemote, see the following document: GAM - GAMRemote Authentication Type

GAMRepository.LoginFacebook() method:

This method consist of authenticating to Facebook, using the the first authentication type of that type, ordered alphabetically.

If more than one Facebook Authentication Type is defined, the following method must be used:

&GAMLoginAdditionalParameters.AuthenticationTypeName    = !"facebook2"
GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection)

Mobile:

GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Facebook, &UserName, &UserPassword)

Or in case you have defined more than one:

&LoginExternalAdditionalParameters.AuthenticationTypeName = !"facebook2"
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Facebook, &UserName, &UserPassword, &LoginExternalAdditionalParameters)

To Learn more about Facebook Authentication Type, see the following document: GAM - Facebook Authentication Type

GAMRepository.LoginTwitter() method:

This method consist of authenticating to Twitter, using the the first authentication type of that type, ordered alphabetically.

GAMRepository.LoginTwitter()

If more than one Twitter Authentication Type is defined, the following method must be used:

&GAMLoginAdditionalParameters.AuthenticationTypeName    = !"Twitter2"
GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection)

Mobile

GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Twitter, &UserName, &UserPassword)

Or in case you have defined more than one:

&LoginExternalAdditionalParameters.AuthenticationTypeName = !"Twitter2"
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Twitter, &UserName, &UserPassword, &LoginExternalAdditionalParameters)

To Learn more about Twitter Authentication Type, see the following document: GAM - Twitter Authentication Type
 

GAMRepository.LoginGoogle() method:

This method consist of authenticating to Google, using the the first authentication type of that type, ordered alphabetically.

If more than one Google Authentication Type is defined, the following method must be used:

&GAMLoginAdditionalParameters.AuthenticationTypeName    = !"Google2"
GAMRepository.Login(&UserName, &UserPassword, &GAMLoginAdditionalParameters, &GAMErrorCollection)

Mobile

GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Google, &UserName, &UserPassword)

Or in case you have defined more than one:

&LoginExternalAdditionalParameters.AuthenticationTypeName = !"Google2"
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Google, &UserName, &UserPassword, &LoginExternalAdditionalParameters)

To Learn more about Google Authentication Type, see the following document:GAM - Google Authentication Type
 

GAMRepository.LoginOAuth20() method:

This method consist of authenticate using OAuth20 against any External Identity Provider, and it uses the authentication tpye specified in the &AuthenticationTypeName parameter who is required in this metod.

GAMRepository.LoginOAuth20(&AuthenticationTypeName) //&AuthenticationTypeName must match the backend definition

Mobile

&LoginExternalAdditionalParameters.AuthenticationTypeName = !"OAuth20-Google" 
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Oauth20, &UserName, &Password, &LoginExternalAdditionalParameters)

To Learn more about OAuth Authentication Type, see the following document: GAM - OAuth 2.0 Authentication Type

See Also

GAM - Authentication Types

 



 

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant