I receive an error from the authorisation server, saying that the redirect_uri is incorrect. However, when I inspect the response the redirect_uri in their parameters is redirect_uri=http://localhost:5000/login/mylogin/authorized. This seems to suggest that Flask-Dance is not passing the redirect_url on correctly, so a default is being passed instead (/login/<name>/authorized). If I manually correct the response URL, it works correctly.
redirect_url is where to redirect the user after the OAuth dance successfully completes. Based on your description, I think you want to set authorized_url. See the docs for OAuth2ConsumerBlueprint.
I have built a custom blueprint, following the docs, but the
redirect_url
parameter is not being passed on.Here is my blueprint:
I receive an error from the authorisation server, saying that the redirect_uri is incorrect. However, when I inspect the response the redirect_uri in their parameters is
redirect_uri=http://localhost:5000/login/mylogin/authorized
. This seems to suggest that Flask-Dance is not passing the redirect_url on correctly, so a default is being passed instead (/login/<name>/authorized
). If I manually correct the response URL, it works correctly.