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

How to request non-standard claims for id_token #162

Open
jgiacomoni opened this issue Apr 19, 2024 · 2 comments
Open

How to request non-standard claims for id_token #162

jgiacomoni opened this issue Apr 19, 2024 · 2 comments

Comments

@jgiacomoni
Copy link

jgiacomoni commented Apr 19, 2024

We are using pure implicit flow (id_token only) to request non-standard claims with standard and non-standard scope values.

EDIT scopes won't work for us as we need to be able to specify various attributes/value for each requested claim.

per https://openid.net/specs/openid-connect-core-1_0.html#Claims

we should be able to specify something like this in the authorization query params

{
"id_token":
{
"field_x": {
"essential": true,
"value" : "y",
"condition" : "z", // non-standard
},
}

If this isn't supported, are there plans to do so? or should I assume I need to manually append these claims to the authorization_url?

thanks!

@ramosbugs
Copy link
Owner

Hey @jgiacomoni,

This can currently be done using AuthorizationRequest::add_extra_param, where claims is the name and the serialized JSON is the value. The value will be URL-encoded automatically, so just pass in the plain JSON.

I'd be open to a PR (after some discussion about the API) for adding a higher-level interface for setting this parameter but don't plan to implement that myself in the near future.

@jgiacomoni
Copy link
Author

@ramosbugs thanks! I'll take a look. I'm currently in prototyping mode so I'll probably just follow your suggestion until I need something more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants