Flow Single Sign On API (SSO API)

Modified on Sun, 29 Jan 2023 at 11:04 PM

Introducing the SSO API


SSO (Single Sign-On) enables attendees to join events directly from your website without

filling out registration forms and having to log in again to the webinar room. Managing separate logins and passwords can be tedious.


If you have a member registration system (a user database and a login page), you can easily implement SSO to eliminate the need to sign in to a Flow webinar room again with another username/password combination. Once you implement SSO, 

  • An attendee logs into the member or subscriber page 
  • You make available a button for them to click - this button is a unique link generated for each attendee using our SSO API
  • An attendee who logged into your website clicks this button and accesses the webinar room without having to log in to the webinar room once more




USE THIS FOR ADDITIONAL INFORMATION

How to Implement SSO on your website?


Use the following instructions carefully to implement SSO integration.


  1. Obtain the list of available rooms in your account

  2. Implement Room Login (SSO)



Step 1: Obtain the list of available rooms in your account 


URL: https://prod.flowapp.com/api/v1/rooms/lookup/{ACCOUNT_TOKEN}

METHOD: GET


Sample Response


{

    "code": 200,

    "data": [{

                    "id": 1,

                    "title": "Room 1",

                    "room_id": 7501,

                    "description": "Room description",

                    "account_token": "accounttoken",

                    "creator_id": 000,

                    "account_id": 0

                },{

                    "id": 2,

                    "title": "Room 2",

                    "room_id": 7502,

                    "description": "Room description",

                    "account_token": "accounttoken",

                    "creator_id": 000,

                    "account_id": 0

                }],

"redirectURL": null

}


Step 2: Implement Room Login (SSO)


URL: https://prod.flowapp.com/api/v1/rooms/register/{roomId}/{ email}'*_*{

firstName}'*_*' + {lastName};


METHOD: GET

You MUST maintain the order of email/firstname/lastname in the above URL! If you pass invalid information or miss any part of the code, the user won't be able to access the webinar room.


Sample Response


{

    "code": 200,

    "data": {

                    "url": "https://prod.flowapp.com/s/4D1ABUJq2P/hpNmXB3ywU/264018",

                    "token": "hpNmXB3ywU",

                    "date": "2023-01-27",

                    "time": "00:00:00",

                    "timezone": "Asia/Calcutta",

                    "isNew": true,

                    "passCode": null,

                    "id": 15796

                    },

"redirectURL": null

}



You will receive a link as part of the response. Use it to redirect the users to this link so that the participants access the webinar room.

SSO API - Sample Code


Javascript Code


// Constants

const USER_DATA = localStorage.getItem('userData');

const ENDPOINT = 'https://prod.flowapp.com/api/v1/rooms/';

const ACCOUNT_TOKEN = '[your account token]';

// Function for fetching rooms and display on website

const fetchRooms = () => {

                           const url = ENDPOINT + 'lookup/' + ACCOUNT_TOKEN;

                           fetch(URL)

                              .then((response) => response.json())

                              .then((json) => {

                                  if (json.data) {

                                      const rooms = json.data;

                                      rooms.map(value => {

                                    $('#roomlist').append('<li>' + value.title + '<button

onclick="join(\'' + value.room_id + '\')">Join</button></li>');

                                                        })

                                                    }

                                                });

}


// Function for room access


const join = (roomId) => {

    const userObject = JSON.parse(USER_DATA) //read user specific data from you login cookie

    const email = userObject.email; // fetch email from cookie

    const firstName = userObject.firstName; // fetch first name from cookie

    const lastName = userObject.lastName; // fetch last name from cookie

    const url = ENDPOINT + 'register/' + roomId + '/' + email + '*_*' + firstName + '*_*'

+ lastName;

        fetch(URL)

        .then((response) => response.json())

        .then((json) => {

            if (json.data) {

                window.location.href = d.data.url;

            } else {

                alert('ROOM NOT EXIST')

                    }

            });

}




PHP Code


Coming Soon...


If you need any help with the implementation, we can help. Contact us so that we can assist you.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article