question

AnjaliAgarwal-1903 avatar image
0 Votes"
AnjaliAgarwal-1903 asked sikumars commented

connecting to azure active directory from asp.net application

I am trying to connect to azure active directory from asp.net application. Below are my values I am putting in the application:

 <add key="ClientId" value="XXXXXXXXXX" />
     <add key="Tenant" value="XXXXXXXXXXXXXXXXXXXX" />
     <add key="Authority" value="https://login.microsoftonline.com/{0}/v2.0" />
     <add key="redirectUri" value="https://localhost:5000/" />

For my redirect URI, I have https://localhost:5000/. This is what I configured in my App registrations in the Azure portal. when I run my application, I get this error:

ldqxq.png

when I change the redirectUri to https://localhost:44368/ then I can see the Microsoft login and Microsoft accepts the userId too, but I get an error after inputting my password saying :

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

any help will be highly appreciated. I am following this article by Microsoft to write the code:

https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-aspnet-webapp#prerequisites

dotnet-csharpazure-active-directorydotnet-aspnet-webforms
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AnjaliAgarwal-1903 ,

I just wanted to check in and see if you had any other questions or if you were able to resolve this issue? If you have any other questions, please let us know. Thank you for your time and patience throughout this issue.


Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

0 Votes 0 ·
CristianSPIRIDON72 avatar image
0 Votes"
CristianSPIRIDON72 answered

Hi @AnjaliAgarwal-1903,

After you have changed the application, did you change also the App registration to the same redirect URI?
It has to be exactly same URI (host and port) otherwise it won't work.

Hope this helps!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered

@AnjaliAgarwal-1903 If you are debugging locally from your machine on port 44368, please change the redirect uri to https://localhost:44368/signin-oidc on the Azure AD App registration page.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.