Using Google Suite as a SAML Provider for Teleport #54053
phall-teleport
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This guide will describe how to set up Teleport to use SAML to authenticate against Google Workspace.
This has some advantages over OIDC, Namely that you can explicitly control what attributes are passed to Teleport (groups, traits etc)
Notes:
I did this with legacy free edition of Google Workspace, I presume if this works with that flavor it will work with any flavor.
Teleport Configuration and presumptions:
Setup SAML Application on Google:
Step 1
Sign in with a super administrator account to the Google Admin console.
Go to Menu and then Apps > Web and mobile apps.
Click Add App and then Add custom SAML app.
Provide a name and description and optional icon I used the white square resized to 256x256 pixels
Step 2:

Download the Google IdP Metadata, you will need this later on.
Step 3:

Fill in the Service Provider (Teleport) details:
(The port number is required)
For Name ID
Step 4:
Set up the mapping between Google and Teleport, this is where we set what is sent to Teleport for a users login and to set up role mapping based on a users groups.
Click Add Mapping
under Basic Information choose Primary Email, for app attributes (this is what we will use in Teleport) enter "username"
For Group membership

On the left side you can choose any groups on your Google instance, for app attribute (what we will use in Teleport) enter "groups"
Click Finish, We have a working SAML instance on the Google side, however it is disabled for our users.


To enable it (you can do this now or come back to it after we set up the Teleport side)
Click on the application:
At the top where it says User Access, click anywhere there and choose on. (It may take a minute to enable)
We are half way done!
Set up the Auth connector on Teleport:
Step 1
Log into Teleport UI as a user with the editor role.
On the left side choose Zero Trust Access -> Auth Connectors
Click Add Auth Connector (top right)

Choose SAML Connector

Step 2
The YAML editor will appear.
Click Save Changes
Step 3
Create or update a role that this user will get. These should be mapped in the step above. In my test instance I mapped a group called "Teleport Developers" from Google to a role called "teleport-developers" in Teleport. You can also update the logins portion in an existing role. Everything else in the role is your discretion, however for logins you may want to do the following. In the example below the users username will be picked up from Google. Teleport will create an attribute for logins with the same thing minus the email domain. (eg [email protected] becomes paul)
At this point we can test!

IMPORTANT Note: if you didn't enable the SAML application at the end of Step 4 in the first half you will need to revisit that portion and enable it.
In an incognito window go to your tenant URL. You should have an additional login button. Click it, and you will get redirected to a Google login prompt.
Also, since we added this as a SAML application a user in your Google Workspace can also access Teleport from the Google UI

IMPORTANT: This will only work if you permitted IdP-initiated SSO in Step 2 of the Teleport setup portion of this document.
Once a user has logged in once you can use tctl and examine this user and what attributes are sent from Google. (note I did notice it took 30-50 seconds from updating a trait to map from the Google side to when I started seeing it through Teleport)
example:
Beta Was this translation helpful? Give feedback.
All reactions