Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Configure Google Single Sign-On (SSO) with Twilio Flex


Google SSO (single sign-on) allows users to use their existing Google account to authorize third-party applications. This allows users to easily login to applications without needing to set up a new account, or create a new set of credentials. In this guide, you will learn how to configure Google SSO with Twilio Flex.


Prepare your Google App environment

prepare-your-google-app-environment page anchor

Before we connect Google to your Flex Instance, you have to configure a few steps in the Google Admin Console to ensure your app runs smoothly.

To log in a Flex user, you must pass three mandatory attributes to Flex in the SAML. Google provides email as an attribute out of the box but does not provide the roles or full_name attributes. You will need to configure these attributes yourself.

(warning)

Warning

All the information supplied from the Identity Provider to Twilio is stored inside Twilio TaskRouter Worker Attributes. Consider local regulations for storing data and only provide data relevant for Flex usage. Learn more about Twilio's Privacy policy here.

  1. Navigate to the User Schema page(link takes you to an external page) in your Google Admin Console.
  2. Click on ADD CUSTOM ATTRIBUTE .
  3. Enter "Flex Details" for Category .
  4. Create the "Roles" and "Full Name" attributes below.

    Flex_Attributes.
  5. Click Add to save your custom attributes.

Optionally, you can add more attributes to accommodate the attributes needed by WFO (Workforce Optimization).


Create a custom SAML app

create-a-custom-saml-app page anchor

SAML apps allow you to use Single Sign-On to authenticate once with a single set of credentials. You can then access different secured applications without needing to authenticate with different credentials each time.

  1. Navigate to Google Admin Console(link takes you to an external page) and click on Apps .
  2. Click Web and mobile apps
  3. Click on Add app > Add custom SAML app
  4. Enter the App name , then click Continue .
  5. Copy your SSO URL and Entity ID and save them somewhere - you'll need these later.
  6. Download your Certificate.

    Google_SSO_2.
  7. Click Continue to proceed over to the Service provider details step.

Service Provider details

service-provider-details page anchor

Next, we need to set up the Service Provider Details. Twilio Flex is the Service Provider in this instance.

SettingValue
ACS URLEnhanced SSO configuration: Copy this value from the Set up your identity provider page, which provides the specific value for your account. Your value will look similar to this: https://login.flex.us1.twilio.com/login/callback?connection=JQxxxx

Legacy SSO configuration: Make sure to replace the Account SID (ACxxxx) with your real Account SID. https://iam.twilio.com/v1/Accounts/ACxxxx/saml2
Entity IDEnhanced SSO configuration: Copy this value from the Set up your identity provider page, which provides the specific value for your account. Your value will look similar to this: urn:flex:JQxxxx

Legacy SSO configuration: Make sure to replace the Account SID (ACxxxx) with your real Account SID. https://iam.twilio.com/v1/Accounts/ACxxxx/saml2/metadata
Start URLhttps://flex.twilio.com/<your-runtime-domain>

This Login Link is available on the Twilio Console SSO configuration page(link takes you to an external page).
Signed ResponseChecked!
Name ID FormatEMAIL
Name IDBasic Information > Primary Email
Google_SSO_4.

Now we need to add attributes that will be passed from the SAML to Flex. Create the three required attributes (case sensitive) to pass to Flex and map them to the appropriate fields.

Google_SSO_3.

Note You need to ensure that you configured the Full Name and Roles attribute from Prepare your Google App environment(link takes you to an external page). Otherwise, these attributes will not appear under the Google Directory attributes.


Add the mapped roles to your G Suite Users

add-the-mapped-roles-to-your-g-suite-users page anchor
  1. Navigate to Google Admin Console(link takes you to an external page) and click on Users .
  2. Select a user and click on their User information section
  3. Scroll to Flex Details , the category name you set for the custom attributes during Step 4 in Prepare your Google App environment(link takes you to an external page) .
  4. Click on the edit icon and add your roles. The current options are agent , admin , and supervisor .

Now that you've configured your app, you must:

  1. Verify your domain if you haven't already. See Verify domain ownership(link takes you to an external page) .
  2. Enable your SAML app. See the Turn on your SAML app section on Set up your own custom SAML application.(link takes you to an external page)

Configure Flex with your Google SSO settings

configure-flex-with-your-google-sso-settings page anchor

Grab the URLs you copied from Step 5 in Create a custom SAML app(link takes you to an external page), and configure SSO on the Flex Console Single Sign-on settings page(link takes you to an external page). Be sure that the Twilio SSO URL field matches the value you provided in Google for ACS URL.

SettingValue
Friendly NameAnything you want
x.509 CertificateOpen the .pem file you downloaded above in your favorite text editor and copy/paste the entire contents of the file including all dashes.
Identity Provider IssuerGoogle's Entity ID (see above)
Single Sign-On URLGoogle's SSO URL (see above)
Default Redirect URLhttps://flex.twilio.com/<your runtime domain>

This Login Link is available at the top of the active SSO configuration page(link takes you to an external page).
Trusted domainsAdd any trusted domains that can be used for login requests. Your Default Redirect URL is automatically included.
Login using popupOptional. When selected, the login page for your identity provider appears in a dedicated popup window. If you are loading Flex within the iframe of another application, you may need to select this option.

Additional SSO configuration

additional-sso-configuration page anchor

Our Configuring SSO page has additional details on how to initiate login from your Identity Provider, how to login to a self-hosted domain, and details on attributes that can be defined for each identity.


Navigate to the Google SSO IdP URL (see above) in incognito mode, login, and you should be redirected to Flex.

Congrats! You now know how to configure Google SSO with Twilio Flex. You can now authenticate yourself into Twilio Flex using your Google account!


Rate this page: