flask-dance icon indicating copy to clipboard operation
flask-dance copied to clipboard

Customizing the token_url and authorization_url based on the request

Open jtmoulia opened this issue 4 years ago • 5 comments

I'm working with an OAuth2 interface where I need to customize the token_url and authorization_url based on parameters passed in the initial OAuth authentication request itself, i.e. I don't know those vars until an OAuth dance has been initiated by the user.

As far as I can tell, with flask-dance's model of defining the OAuth blueprint up-front, the authorization_url and token_url can't be customized. Am I correct?

If there isn't yet a way to customize those variables, how could flask-dance be patched to allow it? Could token_url and authorization_url allow callback functions that return the correct URL for that user's OAuth flow?

Other than this issue, the flask-dance been working great for me and the code is quite readable. Thanks!

jtmoulia avatar Jul 10 '19 23:07 jtmoulia