Facebook v1.1

This package provides capabilities that extend the Avoka Transact platform for users wishing to allow auto-filling the form with data from Facebook account.

This package provides the following components:

  1. Facebook Sign In

    A Maestro button to sign in to a Facebook account

  2. Facebook Auto-Fill

    A Maestro component that includes the sign in button, use this profile button, change profile button and skip.

Supported Fields

The below fields can be fetched from Facebook account

NameDescription
First NameFacebook user first name
Last NameUser last name
Middle NameUser middle name
Gendermale or female
Email AddressUser email address
Date Of BirthFormat dd/MM/yyyy
LocationFor example: Manly NSW Australia
CountryCountry name, for example: Australia
StateState code, for example: NSW
PostcodePostcode number
SuburbSuburb name, for example: Manly

Licensing

Clients must ensure they are appropriately licenses in order to use this package. Organisations who wish to use this package are required to setup account and create application with Facebook directly.

Compatibility

This package has the following compatibility requirements:

ModuleCompatibilityNotes
Transact Manager5.0.0 or above
Transact Maestro5.0.0 or above

Installation Instructions

To install this package please walk through the following procedure:

  1. Unzip the package to a directory on your computer
  2. Import each archive found in the libraries folder to Maestro. Importing these into the Organisation level libraries folder is recommended as this will make the components available to all projects, however they can be imported at the Project level if required.

CSP Configuration

The Content Security Policy (CSP) response header helps you reduce XSS risks on modern browsers by declaring what dynamic resources are allowed to load via a HTTP Header, thereby protecting your solution from a range of vulnerability attacks.

The Facebook integration loads a remote JavaScript library which is injected to the form, and this will get blocked if the form header includes strict Content Security Policy (CSP) settings. By default, Avoka Transact has strict CSP settings configured so these will likely need to be modified in order to enable the Facebook integration.

You can configure CSP settings in Transact Manager at a system wide level via the 'Form Submission Access Controller' service, or at an Organization level in the Security tab. The following Sample CSP demonstrates how to enable the Facebook JavaScript integration:

script-src 'self' https://connect.facebook.net/en_US/sdk.js https://graph.facebook.com; object-src 'none';

For more information see CSP on The Avoka Community

Creating your Client Id

To create your Facebook client id you will need to visit the Facebook for developers.

  1. In order for your applications to access Facebook member data, you would need to create an app in Facebook. If you have an existing application, select it to modify its settings.
  2. From the 'Product Setup' - add new product called 'Facebook Login'.
  3. Under 'Client OAuth Setting' set the flag 'Embedded Browser OAuth Login'
  4. Locate the field 'Valid OAuth redirect URIs', and add the base domain for your forms gateway in Transact (e.g. 'https://transact.yourdomain.com'). This is crucial since the widget uses the JavaScript API.
  5. Navigate to Setting -> Basic and under 'Website' section add the base domain for your forms gateway in Transact (e.g. 'https://transact.yourdomain.com')

Usage Instructions

To configure this component please walk through the following procedure:

  1. Open your form in Maestro and drag and drop the 'Facebook Auto-Fill' component from the Palette
  2. Open the properties section of the 'Login with Facebook' button.
  3. Under 'API Config' section, set your Client Id. See the section below called 'Creating your Client Id'.
  4. Under 'Prefill Mappings' section, map the field name to the field path. (For example 'First Name' is mapped to field path 'data.firstName')
  5. Optional, under 'Options' section, uncheck the 'Show Profile Details' flag to auto fill the form automatically after the user signed in to Facebook, without showing the profile.
  6. Optional, under 'Options' section, check the 'Auto Logout' flag to force logged out from Facebook account after the auto filling the form.

The Maestro widget Facebook Sign In supports 3 states:

  1. optin - this is the initial state.
  2. profileRetrieved - this state is set after the user has logged in to Facebook, and his profile is displayed. Then a rule called onProfileRetrieved is triggered to allow adding some custom implementation.
  3. completed - this state is set after the form fields are filled with Facebook retrieved data. Then a rule called onCompleted is triggered to allow adding some custom implementation.

By default the options available after successfully signing in to Facebook are:

  1. 'Use This Profile' - Auto fill the form with the displayed profile
  2. 'Change Profile' - Sign out from the current Facebook account, and sign in with different account
  3. 'Skip' - Ignore this profile and go back

Release Notes

Version 1.1

  • Added two new rule templates. The first one called onCompleted which runs after populating the form fields. The second rule called onProfileRetrieved which runs after the profile is retrieved.
  • Added rule helpers Is Completed and Is Profile Retrieved.

Maestro Assets

Facebook Auto-Fill Library: exchange.facebook Category: Facebook

Facebook Auto-Fill component

Uses

Properties

Property Category Description Type Default
Show Change Profile Button Options

Show or hide the button 'Change Profile'.

boolean true
Show Use This Profile Button Options

Show or hide the button 'Use This Profile'.

boolean true
Insights Facebook Prefill Insights Milestone Events

If selected, a milestone event will be sent to Transact Insights when form is filled from Facebook.

boolean true
Facebook Sign In Library: exchange.facebook Category: Facebook

Facebook sign in widget button

Used In

Rule Templates

You may add your own logic to handle the following rule types triggered by this component:

  • On Completed : a script to run after retrieving the data from Facebook and populating the fields.
  • On Profile Retrieved : a script to run after the user has logged in to Facebook and their profile is retrieved.

Rule Helpers

The following rule helpers can be used when right-clicking on this component in a script editor:

  • Is Completed
  • Is Profile Retrieved

Properties

Property Category Description Type Default
Client ID API Config

Facebook client id

text
Show Profile Details Options

Show Facebook profile details before auto filling the form

boolean true
Auto Logout Options

Force logged out from Facebook account, after the auto filling the form

boolean false
Facebook Login Image Options

Select from the available images resources, or upload a new one

image {fileName=signin-facebook.png, width=180, height=33}
Prefill Mappings Prefill Mappings

Map the field name to the field path. (For example 'First Name' is mapped to field path 'data.firstName')

Field Refs:

  • firstName : First Name
  • lastName : Last Name
  • middleName : Middle Name
  • gender : Gender
  • emailAddress : Email Address
  • dateOfBirth : Date of Birth
  • location : Location
  • country : Country
  • countryCode : Country Code
  • state : State
  • postcode : Postcode
  • region : Region
  • suburb : Suburb
  • street : Street
fieldRefMap

Shared Styles

  • Facebook actions container Library: exchange.facebook