error AADSTS50011

Arin Leviti 60 Reputation points
2024-01-24T21:29:56.7333333+00:00

I'm trying to publish my website on a virtual machine. I need to use the virtual machine because the website uses an .exe file and I needed somewhere to host it and a machine to run it. I spent days trying to connect my website to a database, and now it finally works. But it works from my local machine. When I publish it on my VM, it gives me this error: AADSTS50011: The redirect URI 'http://arinleviti.italynorth.cloudapp.azure.com/signin-oidc' specified in the request does not match the redirect URIs configured for the application '6cd54832-d1e0-4612-9a74-c441dfeaef4c'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this. I tried to include that string in app registration under Redirect URIs, but it won't accept http, only https, so now I'm stuck. Can I configure Visual Studio to create a https version of that string and deploy it? I'm not even sure why we need a login, when i publish my website on a virtual machine i want it to be accessible to everyone. How do I do that?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
6,794 questions
0 comments No comments
{count} votes

Accepted answer
  1. v-vvellanki-MSFT 2,335 Reputation points Microsoft Vendor
    2024-01-29T04:36:24.3233333+00:00

    Hi @Arin Leviti ,
    Thanks for contacting Microsoft Q&A platform.

    Since Azure AD requires HTTPS for redirect URIs, you need to ensure that your application is accessible over HTTPS. Here's how you can configure Visual Studio to use HTTPS: • In Visual Studio, go to your project properties. • Under the "Debug" tab, find the "App URL" setting. • Change the URL protocol from "http" to "https." • Update the Redirect URI in your Azure AD app registration to use HTTPS. • Ensure that it matches the HTTPS URL of your application. If your goal is to make the website accessible to everyone without requiring a login, you might want to reconsider using Azure AD authentication unless it's a strict requirement. If you need to disable authentication for testing or development purposes, you can do the following: Bypass Authentication: In your application code, you can conditionally bypass the authentication process during development or on specific environments. For example, you can use a configuration setting to control whether authentication is required. Azure AD Configuration: In the Azure portal, you can configure your Azure AD app registration to allow public client flows or not require authentication. However, keep in mind that this might not be suitable for a production environment if authentication is necessary. Hope this helps you.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful