Authenticate a request to content website using AAD

Ajit S 21 Reputation points
2022-01-19T18:56:44.073+00:00

Hi Experts,

I want to authenticate a request to content website created using MVC or any other suitable technology, hosted on on-premise (or non-Azure remote) server using AAD. The request should originate from Website hosted in Azure. If a user copies the url and tries to access the website from his/her browser the authentication must fail. An individual user authentication is not necessary but I would like to know. Unfortunately, I did not find articles which have current Azure version in place. In other words, I could not see the screenshots they provided in those articles. Can someone please help?

Thanks in advance!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,959 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,665 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 11,621 Reputation points
    2022-01-19T19:53:59.2+00:00

    Yes, you can use your web application to authenticate against Azure Active Directory by using Open ID Connect. Refer the following URLs that explains the step by step process for integrating AAD with website

    https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-web-app?tabs=visual-studio

    If the app is hosted in Azure app service, the following document help you.

    https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad

    Once you enable the authentication, and if a user copy the URL of an authenticated resource, and try to access it from an unauthenticated browser, the request will not be served.

    Hope this helps

    1 person found this answer helpful.
    0 comments No comments

  2. Ajit S 21 Reputation points
    2022-01-24T03:30:05.373+00:00

    Thanks @Sreeju Nair for your prompt reply and apologies for delay on my end.

    Let me explain the scenario in details...
    We have Blazor WebAssembly core hosted app. The users are being authenticated using AAD. Here is the url of how the Blazor WASM authentication is set up:
    https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory?view=aspnetcore-5.0

    We will also have a public facing content website which should be accessible ONLY from the blazor server webapi. It does not matter who the user is. Only thing we need to be sure is, request is from WebApi. The files accessed by the WebApi will be presented to the client using "Static Files" architecture.

    Everything else is working except the authentication of WebApi request to the content website using AAD. Any assistance in this regard will be highly appreciated.

    0 comments No comments