AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application

Mohamed Sadak 21 Reputation points
2020-10-22T10:08:45.653+00:00

I want to create an fetcher for my outlook mail,

> Request Id: 629914fc-0b41-4c96-9ffc-55706ae35800
> Correlation Id: daf4939a-1395-454d-a30f-4f92f8d80867
> Timestamp: 2020-10-22T09:18:38Z
> Message: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: 'f1ca17d2-b9af-4f67-a9f4-3a18ab69fd4c'.

I'm using flask with reply url localhost:5000/getAToken

also i tried the quickstart application provided by azure 'ms-identity-python-webapp-master.zip' but the same error

@app.route('/getAToken')  
def hello():  
	scopes=	['Mail.Read']  
	credentials=(CLIENT_ID, CLIENT_SECRET)  
	  
	protocol = MSGraphProtocol()   
	account = Account(credentials, protocol=protocol)  
	if account.authenticate(scopes=scopes):  
   		print('Authenticated!')  
  
	account.connection.refresh_token()  
	mailbox = account.mailbox()  
	inbox = mailbox.get_folder(folder_name='Inbox')  
	  

@soumi-MSFT @AmanpreetSingh-MSFT

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,606 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,311 Reputation points
    2020-10-22T10:42:59.597+00:00

    Hi @Mohamed Sadak · The reply url (redirect_uri) in the request is http://127.0.0.1:5000/getAToken and the reply url registered in the app is http://localhost:5000/getAToken.

    To resolve the issue you can:

    • Either access the application by using http://localhost:5000 and not using http://127.0.0.1:5000.
    • Or register http://127.0.0.1:5000 as reply url in the application.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    5 people found this answer helpful.

0 additional answers

Sort by: Most helpful