AADSTS500113: No reply address is registered for the application. | How to resolve this ?

Aman Prakash Singh 20 Reputation points
2024-07-18T13:30:03.08+00:00

Hi there I am using replit to write a telegram bot that updates the user input to a excel file. I connected ms graph api to my code. It didn't worked I mean worked but the excel file wasn't updated. So I tried getting the access token which was a success and then implemented that code the error wasn't resolved so I tried connecting it through the manual authorization process the login screen to permit the access token it showed another eror then I came over this..

No matter what I am trying whateber I am adding in the azure portal the link remains the same. My get access token function

import logging
import msal
from hi import CLIENT_ID, TENANT_ID
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("main")
SCOPES = ["https://graph.microsoft.com/.default"]
def get_access_token():
    authority = f"https://login.microsoftonline.com/{TENANT_ID}"
    app = msal.PublicClientApplication(CLIENT_ID, authority=authority)
    try:
        result = app.acquire_token_interactive(scopes=SCOPES)
        access_token = result.get('access_token')
        if access_token:
            return access_token
        else:
            error_msg = result.get('error_description', result.get('error', 'Unknown error'))
            logger.error(f"Failed to retrieve access token: {error_msg}")
            raise Exception(f"Could not retrieve access token: {error_msg}")
    except Exception as e:
        logger.error(f"Exception while retrieving access token: {str(e)}")
        raise
# Example usage:
try:
    token = get_access_token()
    print("Access token:", token)
except Exception as e:
    print("Error:", str(e))

ggyfd

My Images of at the azure portal are

png-ms-graph-ss

ssjhhu

ssgfhgjh

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2024-07-19T02:31:01.41+00:00

    Hi @Aman Prakash Singh

    Have you added a redirect URL for your app in Entra ID? You also need to make sure that the redirect URL you added in Entra ID is consistent with the redirect URL configured in the code.

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2024-07-18T13:30:03.13+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message "AADSTS500113: No reply address is registered for the application" indicates that there is no reply URL registered for the application. This error can occur if the reply URL is not configured correctly in the Azure portal. You can try verifying that the reply URL in the Azure portal is correct and matches the reply URL set on the registered app in Microsoft Entra ID.

    Additionally, you can consult the README.md file included with the quick start project for instructions about how to create an app registration and configure it in the sample code.


    References:

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.