Heroku related Auth0 Problem: Unable to issue redirect for OAuth 2.0 transaction

I am currently developing a Flask App that uses Auth0 for authentication.

Testing on my local machine everything works fine. I was able to login and logout with auth0.

Now I deployed the same Flask App to heroku, adjusted AUTH0_CALLBACK_URL, but it does not work anymore:

   oauth = OAuth(app)
    auth0 = oauth.register(
        'auth0',
        client_id=AUTH0_CLIENT_ID,
        client_secret=AUTH0_CLIENT_SECRET,
        api_base_url=AUTH0_BASE_URL,
        access_token_url=AUTH0_BASE_URL + '/oauth/token',
        authorize_url=AUTH0_BASE_URL + '/authorize',
        client_kwargs={
            'scope': 'openid profile email',
        },
    )
    @app.route('/login', methods=['GET'])
    def login():
        #redirect to auth0
        return auth0.authorize_redirect(redirect_uri=AUTH0_CALLBACK_URL, audience=AUTH0_AUDIENCE)

I can see the auth0 login page, but after login I always get the auth0 error page with the following error:
“Unable to issue redirect for OAuth 2.0 transaction”

I tried a lot of things to fix it, but nothing seems to work. I also replaced the AUTH0_CALLBACK_URL with the url itself and tried to adjust the auth0 settings, but nothing works.

I am really clueless at the moment and hope someone has an idea what causes this problem.

Best regards,
R

Just fixed it. The problem is the procfile. The release part of the procfile led to fails in the latest deployments, therefore the adjusted AUTH0_CALLBACK_URL was not applied.

1 Like

Thanks for sharing that with the rest of community!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.