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

Support configurable OAUTH redirect URLs #438

Open
thedumbterminal opened this issue May 14, 2022 · 7 comments · May be fixed by #442
Open

Support configurable OAUTH redirect URLs #438

thedumbterminal opened this issue May 14, 2022 · 7 comments · May be fixed by #442
Labels
enhancement New feature or request

Comments

@thedumbterminal
Copy link

thedumbterminal commented May 14, 2022

Is your feature request related to a problem? Please describe.
Currently when using oauth the redirect URL is hardcoded here:

https://github.com/python-restx/flask-restx/blob/master/flask_restx/templates/swagger-ui.html#L55

The included oauth2-redirect.html is fine unless you are implementing OAUTH on the server side where you need logic such as creating a user account etc.

Describe the solution you'd like
I'd like to set my own OAUTH redirect URL so after the OAUTH dance I can create user accounts, for example using flask-security. This could be done via an flask app config setting.

Describe alternatives you've considered
Did briefly consider how to redirect the default swagger redirect URL, but it seems wrong to use it for anything other than documentation needs.

Additional context
Example of using flask-dance for oauth to allow specific OAUTH handlers:

https://github.com/singingwolfboy/flask-dance-github

I've got a working branch here, which I can submit a PR for if the feature is accepted:

https://github.com/python-restx/flask-restx/compare/master...thedumbterminal:oauth-redirect?expand=1

@thedumbterminal thedumbterminal added the enhancement New feature or request label May 14, 2022
@zachanator070
Copy link

Ran into this exact same problem today, hope to see a fix.

@thedumbterminal thedumbterminal linked a pull request Jun 5, 2022 that will close this issue
@thedumbterminal
Copy link
Author

Just raised the PR for the branch with my change in the hope that it gets noticed.

@thedumbterminal
Copy link
Author

Hi @j5awry are you able to give any feedback on this issue, or review the linked PR? Thanks.

@thedumbterminal
Copy link
Author

HI @ziirish are you take a review on the PR or point me in the direction of someone else who can? thanks

@thedumbterminal
Copy link
Author

@peter-doggart are you able to review this?

@peter-doggart
Copy link
Contributor

@thedumbterminal This is on my to-do list. Just haven't had a chance to do any updates lately, but I will make sure this makes it into the next release.

@thedumbterminal
Copy link
Author

Thanks 🙏

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

Successfully merging a pull request may close this issue.

3 participants