3

With my outlook.com account I logged in to portal.azure.com and I created a new application. Microsoft has provided a sample app (daemon_console) for quick experiments (in QuickStart guide) and I followed steps provided for the sample app, the app automatically takes the application id and client secret you generated and updates the configuration JSON file (appsettings.json) with this info. I downloaded the code after these steps but when I run the sample app it throws the error "Authorization_IdentityNotFound".

Looks like it is able to fetch the token but following code is throwing the error:

            var httpClient = new HttpClient();
            var apiCaller = new ProtectedApiCallHelper(httpClient);
            await apiCaller.CallWebApiAndProcessResultASync($"{config.ApiUrl}v1.0/users", result.AccessToken, Display);

Microsofts page has step to get Admin consent in two ways:

  • If you are a global administrator, go to API Permissions page select Grant admin consent for Enter_the_Tenant_Name_Here
  • Standard user If you're a standard user of your tenant, then you need to ask a global administrator to grant admin consent for your application. To do this, give the following URL to your administrator: https://login.microsoftonline.com/common/adminconsent?client_id=my apps client id

I have tried both these options. With the first option, I am able to grant the required permissions. But the issue still exists.

With the second option when I go to the suggested URL it fails with error: "AADSTS500113: No reply address is registered for the application."

I think this should have been a straightforward process but somehow the app is not able to execute and fails with errors:

 "code": "Authorization_IdentityNotFound",
"message": "The identity of the calling application could not be established.",

Please let me know if anyone has tried these steps and has managed to resolve this issue.

Note that I can run "https://graph.microsoft.com/v1.0/users" from graph explorer with my outlook.com account and it works perfectly fine.

1 Answer 1

1

I tested it, and at first I was running into the same issue, its because of the common in the appsettings.json

replace the   "Tenant": "common" 
with   "Tenant": "your Tenant ID",

You can get the tenant ID from the overview page of your app registration Directory (tenant) ID. After you do that, make sure you right click the project and click rebuild. because if I just do a normal run it had it cached and did not update it from common.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect. Thanks! Looks like this was missed in the steps MSFT provided. Thanks for spotting this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.