-
Notifications
You must be signed in to change notification settings - Fork 935
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
OIDC: Add additional scopes #14888
OIDC: Add additional scopes #14888
Conversation
Can be rebased now to remove linter commit |
d7a900a
to
143993a
Compare
@tomponline this is ready for review |
lxd/cluster/config/config.go
Outdated
|
||
// lxdmeta:generate(entities=server; group=oidc; key=oidc.additional_scopes) | ||
// Specify additional scopes to be requested when performing OIDC flows. | ||
// Additional scopes might be required if managing access control in the Identity Provider (see {ref}`identity-provider-groups`). |
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.
// Additional scopes might be required if managing access control in the Identity Provider (see {ref}`identity-provider-groups`). | |
// Additional scopes might be required if managing access control in the Identity Provider (see: {ref}`identity-provider-groups`). |
lxd/cluster/config/config.go
Outdated
// Additional scopes might be required if managing access control in the Identity Provider (see {ref}`identity-provider-groups`). | ||
// The default value for this configuration option contains two scopes which are optional, but will degrade LXD OIDC functionality if removed. | ||
// These are: | ||
// - `profile`: This is requested by LXD to present display names for the identification of end users. If it is removed, only email addresses will be displayed. |
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.
// - `profile`: This is requested by LXD to present display names for the identification of end users. If it is removed, only email addresses will be displayed. | |
// - `profile`: This is requested by LXD to present display names for the identification of end users. If it is removed, only email addresses are displayed. |
Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
There will be more additional optional configuration with the addition of `oidc.additional_scopes` so it makes sense to keep them together. This also simplifies the `NewVerifier` function. Signed-off-by: Mark Laing <[email protected]>
Additionally, defined `requiredScopes` as the scopes that are always requested. Signed-off-by: Mark Laing <[email protected]>
Previously just logging a warning here but we should return as well to avoid a nil pointer exception. Signed-off-by: Mark Laing <[email protected]>
Additionally, stop setting the groups claim as a scope. Signed-off-by: Mark Laing <[email protected]>
The additional scopes are marshalled as JSON. Signed-off-by: Mark Laing <[email protected]>
…er`. Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
… is updated. Signed-off-by: Mark Laing <[email protected]>
This changes the following: - Stops using the value of `X-LXD-OIDC-groups-claim` as a scope. - Stops requesting `offline_access` and `profile` by default. - Gets additional scopes by unmarshalling the value of `X-LXD-OIDC-additional-scopes`. If an old client connects to a new LXD server, they will continue to request `offline_access` and `profile` scopes by default, but will not request any additional scopes. Nor will they receive the groups claim header. If a new client connects to an old server, they will only request the `openid` and `email` scopes. This is sufficient for logging in in most cases. Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
143993a
to
4a082dd
Compare
Discussed with Tom that this needs extra work. If both |
@markylaing shall we close this for now? |
I don't think so. Making this configurable is useful for @ech0-de (for Gitlab OIDC) and as far as I know the only contentious thing is how to unset both How about we introduce two keys?
That said, I guess another point of contention I have with our OIDC implementation is the use of headers to send e.g. the issuer URL to the LXD client. I think these values should be returned via |
I don't like this idea either. We can just have |
Closing in favour of #14935. |
Adds an
oidc.additional_scopes
configuration key which defaults toprofile,offline_access
.Removes the
oidc.groups.claim
value from requested scopes.Things I'm not sure on:
profile
andoffline_access
scopes.Requires #14871
Closes #14141