-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Extend payload #2876
Comments
Thank you for opening this @loafoe! Indeed a solution with a smaller scope may be easier to incorporate into Dex, but as part of the external connector effort (#1907) the connector interface maybe redesigned and this feature maybe replaced with something else (eg. middleware). In any case, this proposal is worth exploring. Would you mind opening an enhancement proposal? I also wonder if it would make sense at this point to introduce an internal representation for the payload. That could serve as a basis for future improvements, like custom claims. |
Hi @sagikazarmark sorry for the delay. Just submitted a PR #2954 for the initial draft of the proposal. Feedback appreciated! |
It'd be great to have that! |
Preflight Checklist
Problem Description
Dex has very rigid
claims
support. Adding additional claims via a connector requires forking the code and making changes to various internal structures. There are a number of proposals where this discussed, namely #1635 . The scope of these is fairly large and we are exploring a possible solution that limits itself to just mutating of the claims.Proposed Solution
We propose adding a new
PayloadExtender
interface which connectors can choose to implement:By implementing this interface connectors get a chance to mutate the
id_token
payload just before it is signed. Thescopes
may be used to perform conditional mutation. Thepayload
is passed as a byte array as well as theconnectorData
associated with the authorization request. This allows the connector to pass context viaconnectorData
. The resulting mutated structure is returned including an error condition.A working example of this interface implementation could look like this (actual working code):
This results in a
teams
claim being available in theid_token
. A working implementation can be found in this fork.Alternatives Considered
Alternatives are to maintain a fork with these changes.
Additional Information
There are only minimal (non-breaking) changes required to the core dex to support this, essentially changes to propagate the
connectorData
to the token generation logic. We have successfully tested this approach. If this is interesting I'm happy to write aDex Feature Proposal
which further details.The text was updated successfully, but these errors were encountered: