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

Twilio is launching a new Console. Some screenshots on this page may show the Legacy Console and therefore may no longer be accurate. We are working to update all screenshots to reflect the new Console experience. Learn more about the new Console.

Have you already configured SSO using the endpoint? Learn how to update your existing configuration with the Flex SSO Migration Guide. Additionally, Twilio does not yet support SP-Initiated SSO flows with Google SSO. Only IdP-Initiated SSO flows are supported at this time.

1. Prepare your Google App environment

Before we connect Google to your instance of Flex, we have to build a few things in the Google Admin Console to make things run a little bit more smoothly.

To log in a Flex user, you must pass a minimum of three 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. We will need to build these ourselves.

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 in your Google Admin Console.
  3. Category = Flex Details
  4. Create the two attributes below
Name Info Type Visibility No. of Values
Roles Text Visible to Admin Multi-value
Full Name Text Visible to Admin Single Value

Google User Custom Attributes

Optionally, you can add more attributes to accommodate the attributes needed by WFO.

2. Create a custom SAML app

Navigate to the Google Admin Console and click on Apps

Google Admin Console

Click SAML apps.

Google SAML apps

Then click the "Add a service/App to your domain" link, or click the + icon at the bottom right.

Google SAML App Add

a. Enable SSO for SAML application


Google SAML App - 1

b. Google IdP Information

Download the certificate in the Option 1 section, and make a note of the SSO URL and Entity ID – you'll need these later.

Google SAML App - 2

c. Basic information for your custom app

  • Set your Application Name – This might be "Twilio Flex", or a name of your choosing
  • You may optionally add a description and logo

Google SAML App - 3

Here's a logo you can use!


d. Service provider details

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

Setting Value

Make sure to replace the Account SID (ACxxxx) with your real Account SID.

Entity ID

Make sure to replace the Account SID (ACxxxx) with your real Account SID!

Start URL<your-runtime-domain>

This Login Link is available on the Twilio Console SSO configuration page.

Signed Response Checked!
Name ID

Basic Information & Primary Email

Name ID Format EMAIL

Google SSO Flex (IAM v1)

e. Attribute mapping

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

Attribute Mapping

3. Add the mapped roles to your G Suite Users

Navigate back to the Google Admin Console and click on Users.

Screen Shot 2019-03-27 at 5.46.13 PM.png

Select a user and click into their User information section.

Screen Shot 2019-03-27 at 5.46.48 PM (1).png

Scroll to the attribute name you gave your Flex roles (in this example it's 'Flex Roles') and click the edit icon to add your roles. The current options are 'agent', 'admin', and 'supervisor'.

Screen Shot 2019-03-27 at 5.47.25 PM.png

Complete the setup

Now that you've configured your app, you must

4. Configure Flex with your Google SSO settings

Grab the URLs you noted in the Google IdP Information section and configure SSO on the Flex Console Single Sign-on settings page. Be sure that the Twilio SSO URL field matches the value you provided in Google for ACS URL. To learn more about migrating from the URL to see our migration guide.


Setting Value
Friendly Name Anything you want
x.509 Certificate Open 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 Issuer Google's Entity ID (see above)
Single Sign-On URL Google's SSO URL (see above)
Default Redirect URL<your runtime domain>

This Login Link is available at the top of the active SSO configuration page.

Immediately after you’ve configured your IDP to use the URL you should update the Twilio SSO URL for your account by selecting the USES IAM.TWILIO.COM radio button.

Additional SSO Configuration

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.

5. Testing Google SSO

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


Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more