Skip to content
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

Add guides for common OIDC providers #3917

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Add guides for common OIDC providers #3917

merged 1 commit into from
Nov 20, 2023

Conversation

makkes
Copy link
Member

@makkes makkes commented Aug 4, 2023

This is a first revision of this guide and likely subject to extension/improvement going forward but it'll definitely help setting up Weave GitOps as an OIDC client properly.

https://staging.docs.gitops.weave.works/oidc-guides/docs/next/guides/oidc/

@lasomethingsomething lasomethingsomething added the user-guide Improvements to docs at https://docs.gitops.weave.works/ label Aug 7, 2023
@lasomethingsomething
Copy link
Contributor

What's the status of this?

@makkes
Copy link
Member Author

makkes commented Nov 6, 2023

I really want to get this in but haven't found the time to move it to a reviewable state. Will see if I can get it there by end of this week.

@lasomethingsomething
Copy link
Contributor

@makkes Got it, thanks much. PTAL at the other draft docs PRs on OIDC and see if you can bring them together into a structure that works. We can also do this together if you'd like.

@makkes makkes force-pushed the oidc-guides branch 3 times, most recently from 7d1ccbe to 1758064 Compare November 14, 2023 14:10
@makkes makkes marked this pull request as ready for review November 14, 2023 14:10
@makkes makkes added the documentation Improvements or additions to documentation label Nov 14, 2023
@makkes
Copy link
Member Author

makkes commented Nov 14, 2023

@enekofb @bigkevmcd this is now finally ready for review.

Copy link
Contributor

@enekofb enekofb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Some small suggestions added.

🙏 please also share some background on how the suggested configurations were tested / validated.

website/docs/guides/oidc.mdx Outdated Show resolved Hide resolved
website/docs/guides/oidc.mdx Outdated Show resolved Hide resolved
website/docs/guides/oidc.mdx Outdated Show resolved Hide resolved
website/docs/guides/oidc.mdx Show resolved Hide resolved
@enekofb
Copy link
Contributor

enekofb commented Nov 15, 2023

adding some more folks for visibility.

website/docs/guides/oidc.mdx Outdated Show resolved Hide resolved
website/docs/guides/oidc.mdx Show resolved Hide resolved
redirectURL: http://YOUR_WEAVE_GITOPS_DOMAIN/oauth2/callback
customScopes: openid
claimUsername: sub
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to talk about the groups on Azure?

And recommend that users use roles https://learn.microsoft.com/en-us/security/zero-trust/develop/configure-tokens-group-claims-app-roles ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 I will need to set this up one more time to see what specifically is necessary for getting the groups.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this once more and added a step to configure group claims.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this get pushed?

       customScopes: openid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The funny thing is you don't need to request any other scope if the groups claim is configured. The claim will be pushed nonetheless. 🤷🏻‍♂️ Microsoft doing Microsoft things.

@makkes
Copy link
Member Author

makkes commented Nov 16, 2023

🙏 please also share some background on how the suggested configurations were tested / validated.

I validated them all manually. The perfect setup would be for us to add e2e tests to the code base verifying proper OIDC functionality but that's completely out of scope of this PR. I'd be happy to start this afterwards, though.

@makkes
Copy link
Member Author

makkes commented Nov 16, 2023

@enekofb @bigkevmcd addressed all your comments. ptal

Copy link
Contributor

@enekofb enekofb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -135,6 +135,8 @@ You may decide to give your engineering teams access to the WGE dashboard so the

OIDC extends the OAuth2 authorization protocol by including an additional field (ID Token) that contains information (claims) about a user's identity. After a user successfully authenticates with the OIDC provider, Weave GitOps Enterprise uses this information to impersonate the user in any calls to the Kubernetes API. This allows cluster administrators to use RBAC rules to control access to the cluster and the dashboard.

For more specific examples of how to setup OIDC with Weave GitOps, see [this guide](../../../guides/oidc/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@makkes
Copy link
Member Author

makkes commented Nov 20, 2023

@bigkevmcd do you want to take another look at this? I'd love to merge this today or tomorrow so we can take care of #4113 next.

This is a first revision of this guide and likely subject to
extension/improvement going forward but it'll definitely help setting
up Weave GitOps as an OIDC client properly.

Signed-off-by: Max Jonas Werner <[email protected]>
## Google

Google's identity provider does not support the groups scope which Weave GitOps requests by default. That's why in
this example the `customScopes` field is set to only request the `openid` and `email` scopes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

redirectURL: http://YOUR_WEAVE_GITOPS_DOMAIN/oauth2/callback
customScopes: openid
claimUsername: sub
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this get pushed?

       customScopes: openid

1. Log in to the Keycloak admin console and [create a realm](https://www.keycloak.org/docs/latest/server_admin/#configuring-realms).
1. [Create a client application](https://www.keycloak.org/docs/latest/authorization_services/index.html#_resource_server_create_client)
and choose "OpenID Connect" as the client type.
1. Make sure to set the "Client Authenticator" on the "Credentials" tab to "Client Id and Secret" and generate a secret.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to say anything about scopes for the client?

Do we need to say anything about groups for this? (realm roles?!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I basically stopped iterating on this part of the page as soon as #4113 arrived because that PR provides all the nitty-gritty details of using WeGO with Keycloak. So I suppose this part will be overridden soon, anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, maybe we can remove this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And link to the other doc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will as soon as the other doc is merged.

Copy link
Contributor

@bigkevmcd bigkevmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with these, I suspect we'll need to cover more use-cases.

It'd be unfortunate if we become the gate-keepers for every OIDC config.

Copy link
Contributor

@foot foot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff thanks team!

@foot foot merged commit 6b0c193 into main Nov 20, 2023
60 checks passed
@foot foot deleted the oidc-guides branch November 20, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation user-guide Improvements to docs at https://docs.gitops.weave.works/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants