HowTo: Get the email address of a Facebook user

Official Content

When the GAM Authentication Type used is Facebook Authentication, you can retrieve the user's email when he/she registers, that is to say, when he logs into the application for the first time using his Facebook account.

If the Repository settings include Required Email = True, the email is always retrieved from Facebook.

In other case, to get the user's email when he logs in using Facebook Authentication Type, you just need to add the "email" Additional Scope to the Authentication Type configuration, as shown below:

GAM Facebook Authentication Type : Email Additional Scope

When using the GAM API, the code would be as follows:

&AuthenticationTypeFacebook.Facebook.AdditionalScope= "email"

&AuthenticationTypeFacebook is a variable based on GAMAuthenticationTypeFacebook external object - distributed by GeneXus Access Manager.

Then, the user's email in GAM will be the same email that is configured in his Facebook account.

Note:

Once the user has logged in for the first time, when he logs in again his email address is never updated or changed.