ASP.NET Microsoft MFA prompt failed outside IIS server

Soh Wei Le 0 Reputation points
2024-12-19T01:57:10.06+00:00

Hi Guys,

I'm using the below codes for a microsoft MFA prompt for user logins.

            var pca = PublicClientApplicationBuilder.Create(clientId)

                .WithAuthority(new Uri(authority))

                .WithRedirectUri(redirectUri)

                .Build();

            var result = await pca.AcquireTokenInteractive(scopes)

                .WithPrompt(Prompt.ForceLogin)

                .ExecuteAsync();


I hosted this application in my windows server, while running this code in my windows server, the MFA successfully prompted by IIS ( which I can tell from the icon).

After publishing with IIS, accessing the same page with browser on other user's pc failed to get the prompt (The page just flick and nothing happened).

I'm unable to debug it as there's no error message.

Appreciate if someone can give me some heads up on it.

Thanks in adv.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,824 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,577 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.