i
This is not the latest version of this document; to access the latest version, click here.
Official Content

GAM Login Method for web applications

Take the GAMExampleLogin web object as an example where the GAMRepository Login method is used.

GAMRepository is an external object which is part of the GAM library (a folder where all the GAM External objects reside).

The Login method of GAMRepository object receives as parameters UserName (GAMUserIdentificationType), Password (GAMDescriptionMedium Type), AdditionalParameters (GAMLoginAddittionalParameters type) and Errors (GAMErrorType).

GAMLoginAdditionalParameters is an external object (which is part of the GAM library also), defined as the following image shows:

GAMAdditionalParameters

GAMAdditionalParameters has a property named "isBatch" which allows to check the username and user password, without creating a session, that is, without loging in. See the code below:

&AdditionalParameter.AuthenticationTypeName = "Facebook"
&LoginAdditionalParameters.isBatch = TRUE

// Login User
&LoginOK = GAMRepository.Login(&UserName, &UserPassword, &AdditionalParameter, &Errors )
If not &LoginOK
   // Process Error
EndIf

Session Expiration

When the session has expired or you are forced to change the password; the login is in a special state limited only to change the password.
Use the GetUserToChangePassword method to get the current user and then UpdateUserToChangePassword to actually do the update.

For more detail check the GAMExampleChangePassword WebPanel where the following pattern is used:

Event Start
    &User = GAMRepository.GetUserToChangePassword() // get the logged User to change the password:
    ...    
Endevent

Event Enter
    If &UserPasswordNew = &UserPasswordNewConf
        &isOK = GAMRepository.UpdateUserToChangePassword(&UserPassword, &UserPasswordNew, &Errors)
        If &isOK
        ....
Endevent        

GAM Login Method for SD applications

In case of SD applications, take as an example de GAMSDLogin object.

In this case the login is performed using Actions external object, and the login method.

Event 'GXLogin'
    Actions.Login(&User,&Password)
EndEvent

The Actions external object is as follows:

SDActions

Note the LoginExternal method of Actions EO, which is used in case of using any GAM Authentication Type which is not Local (that is Facebook Authentication Type, Twitter Authentication Type, External Web Services Authentication Type).





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