-
Notifications
You must be signed in to change notification settings - Fork 92
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
Use PKCE extension in examples/actix.rs (or other examples) #38
Comments
I'm also trying to accomplish this. I've been tinkering with using an
But rust complains that type annotations needed and that it cannot infer type for |
I made a small demo that tries to show a pkce flow. It does compile, but oxide trips on the handlers access_extensions. I seem to be misunderstanding how to integrate PKCE extension on my endpoint. If anyone cares to help, heres my sample repo: On a side note, I altered the consent page so as to pass the state per issue #42 |
This is being actively tested (without any specific web frontend), maybe the structure of these can help you:
From a quick look it seems your repository sets You may want to build the redirect target dynamically from the url of the |
Sidenote: Getting an error also means that the extension is being called, |
I did shamelessly copy the test case, up to the PkceSetup name and I did guess that it wasn't the PKCE implementation that was incorrect but my endpoint wrapper on top of it. I also did try to include the code_challenge and code_challenge_method params for the POST, without any success. I even tried with the challenge values from RFC 7636 Apendix B. |
I should be passing all the required pkce POST values now. I'm creating a new |
That's slightly embarrasing. Quite simply,
I'll make sure to fix this in an upcoming release. |
Also a win for reproducibility, I would have taken long to guess any connection to |
Darn, I should've catched that on my end too. |
Oh the joy! It works! On a side note, am I right in understanding that when an incorrect |
That is how I understood the RFC but it is not explicit about the error handling here. The PKCE reference says that an error must be returned to the first request while the security considerations for oauth state that an authorization code must be single-use. Furthermore, failing the PKCE challenge most likely means that a man-in-the-middle entity (e.g. another application on a shared communication device) tried to steal your token. Although the error information returned to the geniune client is opaque, failing could be part of detectection and analysis of such an attack. |
As discussed in HeroicKatora#38, this fixes the incorrect implementation of Endpoint for ErrorInto, missing a forward to the wrapped Endpoint, currently returning the default implementation None.
As discussed in HeroicKatora#38, this fixes the incorrect implementation of Endpoint for ErrorInto, missing a forward to the wrapped Endpoint, currently returning the default implementation None.
Hello, I also seem to have gotten a basic PKCE example working with Rocket. My example is not as complete as the above actix one because it is only the backend, my frontend repo is seperate but I used essentially the javascript from https://github.com/thespooler/oxide-actix-pcke. I figured it may be helpful for someone looking to get Rocket working, can post more if anyone needs, thank you guys for the above info - https://github.com/VinceJuliano/oxide-rocket-pkce/blob/main/src/main.rs |
I was wondering if I should hijack this thread or create a new one, and stick with the former. I’m hitting a build error which doesn’t make sense to me and I can’t find what I’m missing.
the error:
but I have
What am I missing here? EDIT: I’m using oxide-auth-async and not oxide-auth |
Hi, just ran into this problem myself. I'd like to use the PKCE extension since it seems to be highly recommended, but I have no idea how to do so with oxide-auth. In general I find the documentation lacking (not blaming, I know it is hard, just stating the fact). Would it be possible to add to the documentation how to do this? It seems like there is some progress above. I'm curious how the author intends for this to be used. I'm personally using axum with a custom |
Did you take a look at my sample above? Basically, the only thing you need to change server-side is adding a PKCE extensions to the endpoint addons. See https://github.com/thespooler/oxide-actix-pcke/blob/8ec03551f884e6fa35048d8043c52fb766555446/src/pkcetest.rs#L68. On the client side, there's more to do, but you can rip it off my sample: https://github.com/thespooler/oxide-actix-pcke/blob/8ec03551f884e6fa35048d8043c52fb766555446/static/index.html#L25. It's all about generating a |
I'm not using |
Project Improvement
Would it be possible to include the PKCE extension technique in the examples/actix.rs? I've been looking through the code and haven't figured out yet how to use PKCE with the code grant flow.
The text was updated successfully, but these errors were encountered: