I have been Following this tutorial https://learn.microsoft.com/en-us/outlook/rest/python-tutorial , but unfortunately ran into an error
i.e. KeyError : access_token
Below is the traceback :
Internal Server Error: /tutorial/gettoken/
Traceback (most recent call last):
File "C:\Users\lenovo\Desktop\myapi\v\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\lenovo\Desktop\myapi\v\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\lenovo\Desktop\myapi\v\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\lenovo\Desktop\myapi\python_tutorial\tutorial\views.py", line 17, in gettoken
access_token = token['access_token']
KeyError: 'access_token'
Response I am getting :
auth_code
'M1dad8e26-8249-7c1a-5cf9-729da0316afd'
redirect_uri
'http://localhost:8000/tutorial/gettoken/'
request
token
{'correlation_id': 'af235c44-37cd-495e-a643-8c4f074a3ab3',
'error': 'invalid_client',
'error_codes': [50011],
'error_description': 'AADSTS50011: The reply URL specified in the request '
'does not match the reply URLs configured for the '
"application: '38ae3415-e1fb-4829-8381-396fbeee2230'. "
'More details: Reply address did not match because '
'requested address did not have a trailing slash.\r\n'
'Trace ID: ddc57b58-5903-4a7b-a031-3bec2eb48300\r\n'
'Correlation ID: af235c44-37cd-495e-a643-8c4f074a3ab3\r\n'
'Timestamp: 2020-02-07 09:54:14Z',
'error_uri': 'https://login.microsoftonline.com/error?code=50011',
'timestamp': '2020-02-07 09:54:14Z',
'trace_id': 'ddc57b58-5903-4a7b-a031-3bec2eb48300'}
I have cross verified each and every step of the my code and there seems no mismatch even in AAD it is same as in tutorial. and facing this issue since last night . can anyone help me out?