API Connection & SSO
Understand the process of creating exhibitor users in the FFAIR portal using the FFAIR API, and setting up SSO for the exhibitors.
1. Enabling API & SSO Integration
To get started with API and SSO, enable the integration in your FFAIR Organiser Portal:
- Log in to your FFAIR Organiser Portal.
- Select the required show from the "Shows" page.
- Navigate to "Show Settings" from the left-hand menu.
- Go to the "API & SSO" section on the settings page.
- Toggle the blue switch to enable the integration.
Once enabled, the API functionality can be used to create, update, and retrieve exhibitor data, while SSO ensures seamless login for exhibitors.
2. GET AUTH TOKEN (GET)
https://us-central1-ffair-live.cloudfunctions.net/endpointsSSO-getAuthToken

3. CREATE EXHIBITORS
The both update/create exhibitors use the same cloud function endpoint:
https://us-central1-ffair-live.cloudfunctions.net/endpointsSSO-createExhibitors

Create/Update Exhibitor request example:
Note: companyName, standName, contactEmail fields cannot be changed.
Note2: exhibitorId should be used when creating a new Exhibitor.



GET EXHIBITORS
https://us-central1-ffair-live.cloudfunctions.net/endpointsSSO-getExhibitors







Exhibitor SSO login
This document describes how to login into the FFAIR Exhibitor portal from an external source. We follow the OAUTH 1.0. HMAC- SHA1 signature to generate and validate the URL
Assumptions:
- Exhibitor users are created in the FFAIR and external system
- Each exhibitor contact has the unique identifier that is the same in both systems
- The API connection in the organiser’s portal is enabled
Request method and URL
HTTP Method: GET
BaseURL: https://app.ffair.io/login/sso
Parameters
You now need to gather all the parameters used in the request and to generate the signature. Below are the list of parameters required.
|
Parameter Name |
Example Value |
Description |
|
clientReference |
0x1vttknep8VizGkTYhL |
This is a pre-shared value that is unique to each exhibitor and has to be uploaded to the both platforms |
|
timestamp |
1318634455 |
This is a UNIX timestamp. The link will expire 1 hour after this time. |
|
showId |
7t9hlzjU4Z7xd5Dq9OXd |
This is a pre-shared value that is unique to each show |
|
signature |
Yndh1rEqdxD%2bSnmF7jbxJ/zAGyo= |
This is a value that has to be generated by using instructions below. |
Parameters need to be encoded into a single string which will be used later. The process to build the string looks like this:
- Encode every key and value that will be signed.
- Sort the list of parameters alphabetically
- For each key/value pair:
- Append the encoded key to the output string.
- Append the ‘=’ character to the output string.
- Append the encoded value to the output string.
- If there are more key/value pairs remaining, append a ‘&’ character to the output string.
The following example string should be created:
|
clientReference=0x1vttknep8VizGkTYhL&signature=Yndh1rEqdxD%2bSnmF7jbxJ/zAGyo=&showId=7t9hlzjU4Z7xd5Dq9OXd×tamp=1318634455 |
Signature base string
The values collected so far need to be joined to make a single string from which we will generate the signature. This is called the signature base string.
To encode the HTTP method, base URL, and SSO parameters into a single string:
▪ Convert the HTTP Method to uppercase and set the output string equal to this value.
▪ Append the ‘&’ character to the output string.
▪ Encode the base URL and append it to the output string.
▪ Append the ‘&’ character to the output string.
▪ Encode the parameter string and append it to the output string.
These steps are made according to the documentation.
Signature base string looks like this:
|
GET&https%3A%2F%2Fapp.ffair.io%2Flogin%2Fsso&clientreference%3D1 0x1vttknep8VizGkTYhL%26showId%3D17t9hlzjU4Z7xd5Dq9OXd%26timestamp%3D1318634455 |
Make sure to percent encode the parameter string! The signature base string should contain exactly 2 ampersand ‘&’ characters. Any percent ‘%’ characters in the parameter string should be encoded as %25 in the signature base string.
Calculating the signature
Finally, the signature is calculated by passing the signature base string and signing key to the HMAC- SHA1 hashing algorithm. The output of the HMAC signing function is a binary string. This needs to be base64 encoded to produce the signature string.
After calculating the signature should looks like this:
Yndh1rEqdxD%2bSnmF7jbxJ/zAGyo=
Putting parameter and signature all together creates a final SSO link:
|
https://app.ffair.io/login/sso?clientreference=0x1vttknep8VizGkTYhL&showId=7t9hlzjU4Z7xd5Dq9OXd×tamp=1318634455&signature=Yndh1rEqdxD%2bSnmF7jbxJ/zAGyo= |
See our documentation here: Public API * SSO