I have an AAD Application - ABC, that needs to access other application XYZ via an exposed api which is - "api://XYZ/general". I`m trying to use MSAL library and using ConfidentialClientApplication mechanism,but it is constantly giving me an error stating -
AADSTS500011: The resource principal named api://XYZ/general was not found in the tenant named ***. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.
Can someone please assist me on how to resolve this error? I have been blocked on this for quite some time now.
Trying to get access token to use Easy Start APIs. Code-
authority = app.config["AUTHORITY"] + '/' + app.config["TENANT"]
aadApp = msal.PublicClientApplication(app.config["CLIENT_ID"], authority=authority)
result = None
accounts = aadApp.get_accounts()
if accounts:
# If a user account exists, use it to acquire a token silently
result = aadApp.acquire_token_silent(scopes=app.config["OB_SCOPE"], account=accounts[0])
if not result:
# No user account or token acquisition failed, perform interactive authentication
result = aadApp.acquire_token_interactive(scopes=app.config["OB_SCOPE"])
access_token = result['access_token']
Error- enter image description here