python3-connect-rest-sample icon indicating copy to clipboard operation
python3-connect-rest-sample copied to clipboard

I cannot connect on Graph

Open derrix060 opened this issue 9 years ago • 3 comments

Hello, when I click to connect on graph, authorize the app, and it redirect to /login/authorized, it throws this error:

127.0.0.1 - - [19/Oct/2017 20:04:13] "GET /login/authorized?code=OAQABAAIAAABHh4kmS_aKT5Xrjzx...[code continue]...uEJ4PzeucIAA&state=cdd6b425-8bfa-4153-b047-623b99545cf7&session_state=a4982c37-1657-4d49-9229-b6a7db65560c HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/mario/Projects/python3-connect-rest-sample/connectsample.py", line 66, in authorized
    response = msgraphapi.authorized_response()
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask_oauthlib/client.py", line 677, in authorized_response
    data = self.handle_oauth2_response()
  File "/home/mario/miniconda3/envs/onedriveEnv/lib/python3.6/site-packages/flask_oauthlib/client.py", line 664, in handle_oauth2_response
    type='invalid_response', data=data
flask_oauthlib.client.OAuthException: Invalid response from microsoft

Does this repository still working?

derrix060 avatar Oct 19 '17 07:10 derrix060

Make sure you have Mail.Send permission set in the console.

thesiti92 avatar Oct 19 '17 14:10 thesiti92

@thesiti92 thank you for your answer. This occur when I tried to login, and if you see on the first line, I receive the code, state and session_state on the link, so I think that there is no problem with the permissions.

derrix060 avatar Oct 19 '17 22:10 derrix060

@thesiti92 are you still running into this error? I've seen that "invalid response from Microsoft" error before, although I've not seen it on this sample. FYI, we also have some new auth samples which may be helpful here: https://github.com/microsoftgraph/python-sample-auth

dmahugh avatar Jan 03 '18 21:01 dmahugh