Closed pamfilos closed 7 years ago
@lnielsen Can't catch it from here https://github.com/inveniosoftware/invenio-oauthclient/blob/master/invenio_oauthclient/handlers.py#L226
The error seems to be generated by Flask-Oauthlib
Can you put a breakpoint there and extract the request.header, request.data, request.code
and paste it here. I'm interested in what is actually in the response from the remote side and why it is considered invalid.
So the issue when you go 'Back' exists because Flask-oauthlib needs the redirect_url
(here), which doesn't exist as it is popped from here and it is None
at that point.
When the redirect_url
is missing CERN Oauth returns an {"error": "invalid_grant"}
which can't be caught from oauth_error_handler
Also, @lnielsen @jirikuncar, how does this thing work for the Github contrib. Does it ever go here?
When you login with CERN OAuth and you go 'Back' it throughs an Internal Server Error
catching the exception and redirecting to homepage fixes the issues