简体   繁体   中英

ASP.NET Core Azure AD Auth - Redirect URI incorrect for network web server

I am creating a web app in ASP.NET Core that uses Azure AD for authentication. When debugging, everything works fine. When published to the local web server, an error occurs:

AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application

Right now, I have the reply_url in azure as https://localhost:5000/signin-oidc , and the callback url in appsettings.json as "/signin-oidc". When registering the app in Azure, you cannot set a local network location as a reply_url (eg. \\\\server\\folderlocation). How can I set this up to have the redirect urls match?

Also, would IIS interfere with this somehow since I set it up like regular ASP.NET apps? I haven't messed with the IIS settings at all, and I've read with ASP.NET Core you basically have to make it pass through IIS because of the properties of aspnetcore.

If you cannot declare two redirect url's then you need to change your reply_url. Or alternatively you can create another client for debugging purposes within your OAuth2 provider so that you want need to deal with this issue.

For the latter approach, Please note that you need to divide your app.settings one for debugging another for production.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM