-
Notifications
You must be signed in to change notification settings - Fork 114
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
Custom redirect URI #191
Comments
This is the problem. Line 205 in 1c6f9a7
We're waiting on the temporary server to exchange token, while the redirect url is a custom url. |
@hannydevelop as a dirty solution for now, you can use a fork I've just made to solve a similar problem https://github.com/k-bx/yup-oauth2 Can be used like this: |
I apologize for the very great delay - the redirect URI is usually given by the provider as part of the application secret (https://docs.rs/yup-oauth2/latest/yup_oauth2/struct.ApplicationSecret.html). I hope we're talking about the same issue! |
@dermesser my keys have a redirect URL configured in them, yes, but non-patched yup-oauth2 doesn't use it, always giving localhost (127.0.0.1). |
I should also mention that the ApplicationSecret provides a list of possible redirect URLs, there can be more than one possible, and there needs to be a way to specify which one you'd like to use (can use any). |
You're right, it appears - this apparently was changed in one of the last refactors (https://github.com/dermesser/yup-oauth2/blob/master/src/installed.rs#L156), so it appears to always fall back to the OOB redirect URI (https://github.com/dermesser/yup-oauth2/blob/master/src/installed.rs#L57). I will take a look at fixing this in the next few days. |
I read the code again with some context, and it seems that the "dirty hack" you showed above is actually the intended way for the API to be used. It solves the issue of selecting the redirect URL, too. In my last comment, I think I misunderstood the underlying issue. So just to clarify, is there still an issue that you cannot solve with the custom flow delegate? |
@dermesser regarding the custom URL – no, no issue. I can make a PR with my current changes. Should I do that, or will you make changes yourself? Separately, there is an issue in general that I have to run a subprocess and capture a string "Please direct your browser to", present user with a web UI giving that URL, then registering a callback (a one-shot signal like |
I'd be interested to see, for sure.
I'm sorry but it sounds like you are contorting yourself with this - the API you are asking for already exists, and the specific method is here: https://github.com/dermesser/yup-oauth2/blob/master/src/authenticator_delegate.rs#L106 - this is an async function and should enable you to do whatever it takes to get a code, and return it to yup-oauth2 logic. Implement this trait, and set the Or do I still not understand your specific issue? :) |
@dermesser aha! Maybe I didn't read the docs well, sorry, will try it out. PR incoming.. |
Hi @dermesser is there an example on how to add a custom redirect URI? I'm using the example from the custom flow and I realized that the token never gets to the URI, because of the
HTTPredirect
method.The text was updated successfully, but these errors were encountered: