Skip to content

Support configurable OAUTH redirect URLs #438

Open
@thedumbterminal

Description

@thedumbterminal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions