-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Better examples needed #28
Comments
I myself would love to see examples of how to define your own additional claims. I've gotten so far as implementing the trait for a struct but I'm not sure what to do with it once I've done that. |
I'd definitely welcome PRs to address any gaps in the examples.
The To construct a new ID token with custom claims (i.e., when acting as an OIDC provider), the additional claims are one of the parameters to These unit tests might be helpful: openidconnect-rs/src/id_token.rs Lines 955 to 1020 in f4a7abe
|
I feel so foolish that I didn't even think to check if you had unit tests. Thanks for pointing me in that direction |
Please ignore everything below, I finally found the issue, I will open up a PR to show how UserInfo can be requested in the example. See: #36
|
Could you elaborate a bit more on that? I gave this a try, but my Rust is not yet perfect. I tried to define a type alias of I did all of this, but at some point I could not call |
Adding additional claims shouldn't require defining your own |
Thanks for your feedback. It got it working! The following code works for me to retrieve group information from Zitadel:
One challenge for me was the existence of |
I eventually was able to take the samples of how to use this (specifically the await example) and turn it into something at compiled. A few things were necessary in order to do that, one of which centered around error handling. I'm sure I did it wrong, but without a better option I'm just going to posit here what I did so that you'll know that A - it didn't appear to me that your example usage code was functional and B - maybe having my sample code helps get to a better solution faster.
cargo.toml
auth.rs
The text was updated successfully, but these errors were encountered: