-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix support for GSuite logins #3122
Conversation
Folks, please review once you get a chance. @benarent some open questions:
Cons:
Pros:
Please review with the product team, and either way, we have to make a call. There is additional changes - the service account approach will only work if it impersonates the request from some real user, in my example it's me. That's why I had to add this as an additional field. The scope no longer requests the admin.groups.readonly, because it will break the login screen, and instead reuqests it via serviceaccount. Domain wide delegation should be enabled and it takes a couple of minutes to kick in sometimes. Needless to say this needs guide update as well. |
Fixes #3029 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, it seems better to not have reliance on local state be the default behavior. Perhaps the google_service_account_file
field could be peeked for a file://
scheme prefix, and otherwise interpreted as in-line json
?
Extra note: When managing service access via Google Admin, these are the two permissions needed.
|
I noticed that this change added
into my already exsiting OIDC connectors, I copied over https://gravitational.com/teleport/docs/oidc/#oidc-connector-configuration , and this was the result. Is it possible to not add it into the connector? Or is it required for validation? I don't want to create extra confusion for 0Auth and KeyClock users. |
@benarent I think I can fix that |
d8f2db1
to
3505f1f
Compare
@benarent fixed |
We reviewed the config options this morning and we are recommending to use Forrests suggestion of using |
This commit fixes support for GSuite logins by using service accounts for access purposes. The resulting connector now looks like: ```yaml kind: oidc version: v2 metadata: name: gsuite spec: redirect_url: https://example.com/v1/webapi/oidc/callback client_id: exampleclientid.apps.googleusercontent.com client_secret: exampleclientsecret issuer_url: https://accounts.google.com # Notice that scope here is not requiested from OIDC exchange anymore, this scope # # https://www.googleapis.com/auth/admin.directory.group.readonly # # is now implicitly requested by the client # scope: ['openid', 'email'] # The setup below is involved and requires careful following of the guides: # # https://developers.google.com/admin-sdk/directory/v1/guides/delegation # https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority # # The service account scopes have to be set to # # https://www.googleapis.com/auth/admin.directory.group.readonly # https://www.googleapis.com/auth/admin.directory.group.member.readonly # # the following paths are supported: # 1. plain path # /var/lib/secrets/gsuite-creds.json # # 2. explicit scheme file:// # file:///var/lib/secrets/gsuite-creds.json # # other schemes are not supported at the moment # google_service_account_file: "/var/lib/secrets/gsuite-creds.json" google_admin_email: "admin@example.com" claims_to_roles: - {claim: "groups", value: "admin@example.com", roles: ["clusteradmin"]} ```
3505f1f
to
05e9a7e
Compare
@benarent @russjones @fspmarshall please re-review. I've updated the docs in the commit as well with the changes. Have adopted the Inline json is not supported as well as any other schemes for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated my cluster and successfully tested the updated G Suite service key URI.
retest this please |
This commit fixes support for GSuite logins
by using service accounts for access purposes.
The resulting connector now looks like: