-
Notifications
You must be signed in to change notification settings - Fork 930
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
Auth: Add OIDC identities to identity cache and extract identity provider groups #12827
Conversation
dfc9bb9
to
86eff12
Compare
@tomponline this is ready for review now. Also, do we prefer |
I would say, as it allows us to use oidc.groups.foo later if needed |
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.
A handful of nits/questions, overall looks great.
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.
Needs an API extension too please
86eff12
to
705e19e
Compare
What would the extension be for? This doesn't add any functionality (yet). Or is it just because we're adding a new config key? |
Yep the new config key is new functionality |
🤔 I suppose it is. You can set some config. I'll update the PR on Monday and will add an API extension check in the client for adding this config key. |
705e19e
to
8a6206a
Compare
Signed-off-by: Mark Laing <mark.laing@canonical.com>
This indicates to the client that it needs to request the additional scope. Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
AuthError implements xerrors.Wrapper so we can use that to inspect the error instead of type assertion. Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
8a6206a
to
c93a157
Compare
@tomponline I've made the requested changes. I haven't checked for the |
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 an api extension commit change
Signed-off-by: Mark Laing <mark.laing@canonical.com>
Signed-off-by: Mark Laing <mark.laing@canonical.com>
This is a false positive. Signed-off-by: Mark Laing <mark.laing@canonical.com>
c93a157
to
458b87c
Compare
When the `oidc.groups.claim` config key was added in canonical#12827, the logic governing optional configuration of the OIDC verifier was incorrect. This caused the config expiry interval to be set to zero if not passed in by the caller. This caused the verifier to rotate the encryption keys of the relying party on every call. These keys are used to encrypt the `state` and `pkce` cookies that OIDC needs to work. As they had been rotated during the OIDC flow, the callback handler to failed to decrypt the cookies, and so login was failing. Signed-off-by: Mark Laing <mark.laing@canonical.com>
When the `oidc.groups.claim` config key was added in canonical#12827, the logic governing optional configuration of the OIDC verifier was incorrect. This caused the config expiry interval to be set to zero if not passed in by the caller. This caused the verifier to rotate the encryption keys of the relying party on every call. These keys are used to encrypt the `state` and `pkce` cookies that OIDC needs to work. As they had been rotated during the OIDC flow, the callback handler to failed to decrypt the cookies, and so login was failing. Signed-off-by: Mark Laing <mark.laing@canonical.com>
This PR adds a new server configuration key
oidc.groups_claim
. If set, the value of this config key is:scope
of the Authorization Code Flow (UI).X-LXD-OIDC-groups-claim
header, to be added to the scope for the Device Authorization Grant Flow (CLI).X-LXD-forwarded-identity-provider-groups
header. The value of this header is a JSON encoded string.#12816 must be merged first.