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

Duplicate validation necessary using OAUTHBEARER? #59

Open
TheJonny opened this issue Oct 15, 2024 · 2 comments
Open

Duplicate validation necessary using OAUTHBEARER? #59

TheJonny opened this issue Oct 15, 2024 · 2 comments
Milestone

Comments

@TheJonny
Copy link

I'm not yet decided if this is a bug report or a support/documentation request, as I might have missed something or using it wrong:

When using the server side of the OAUTHBEARER mechanism, the token has to be validated once in the SessionData::callback for OAuthBearerValidate.

This might also obtain information about the user, for example a username. (In my application I would query the OIDC userinfo endpoint using the provided token).

Then I don't see a obvious possibility to store this data to return it from a later validate callback that would e.g. create an user object for later use, requiring to redo the validation.

@dequbed
Copy link
Owner

dequbed commented Oct 15, 2024

You're right, especially mechanisms that include arbitrary side-band data like OAUTHBEARER are not handled very well by rsasl. The initial idea was to allow storing exactly that information in SessionData, but that is sadly impossible now without breaking the API. Not to mention that it's also rather complex to do because you'd want to be able to store a discrete custom type, which would mean a new round of type erasure from an entirely new set of users. It's planned for v3, combined with a few other breaking changes.

That being said there is a possible but slightly ugly workaround right now: You construct a new SASLConfig for each connection having a different Callback instance, making use of the fact that both callback and validate are called with the same &self instance.

@dequbed dequbed added this to the v3.0.0 milestone Oct 15, 2024
@dequbed
Copy link
Owner

dequbed commented Oct 15, 2024

This issue is also basically the same as #13 , just a different view on the same underlying problem.

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