How to integrate Facebook SSO in the GAS

Configuration for an application you want to get authenticated via facebook.

About this task:

Facebook SSO requires OAuth authentication. Specify the OAUTH parameter in the DELEGATE element of your application configuration.

  1. Execute the envoidc.sh script to set the environment.
    This script is located in $FGLDIR\web_utilities\services\openid-connect.
  2. Run the ImportOAuth program to import the Facebook endpoints.
    Note: This is a once-off operation to import the endpoints. Once the endpoints are registered in the database, you can continue to configure your applications for Facebook. For more information, see The ImportOAuth program.
    In the following example line breaks are added for readability.
    fglrun ImportOAuth --import 
                --authz https://www.facebook.com/v3.0/dialog/oauth
                --token https://graph.facebook.com/v3.0/oauth/access_token 
                --logout https://www.facebook.com/logout.php 
                --profile https://graph.facebook.com/me
                https://www.facebook.com 
  3. In the application configuration file add an OAUTH parameter in the DELEGATE element.
    <APPLICATION>
      <EXECUTION>
        <PATH>c:\user</PATH>
        <MODULE>facebook.42r</MODULE>
        <DELEGATE service="services/OpenIDConnectServiceProvider">
          <OAUTH>https://www.facebook.com</OAUTH>
          <CLIENT_PUBLIC_ID>PUBLIC_ID registered on facebook developer console</CLIENT_PUBLIC_ID>
          <CLIENT_SECRET_ID>SECRET_ID registered on facebook developer console</CLIENT_SECRET_ID>
        </DELEGATE>
      </EXECUTION> 
    </APPLICATION>
    • The OAUTH parameter specifies the Facebook URL.
    • The CLIENT_PUBLIC_ID and CLIENT_SECRET_ID are tokens obtained when registering your GAS for Facebook Single Sign-On.