asp.net Web application signing in Azure Active Directory

Anjali Agarwal 1,591 Reputation points
2021-11-07T00:21:56.847+00:00

I have the following code in my application for AD authentication:

public void SignIn()
{
    if (!Request.IsAuthenticated)
    {
        HttpContext.GetOwinContext().Authentication.Challenge(
            new AuthenticationProperties{ RedirectUri = "/" },
            OpenIdConnectAuthenticationDefaults.AuthenticationType);
    }
}

I am getting authenticated without seeing this single sign-on window. I just choose the option of "Stay Signed in" and after that I never saw this window. I am getting authenticated, but no window even if I close the application and reopen it again.

NXMEK.png

I am calling SignIn method from PageLoad of my asp.net application.

Any help will be appreciated.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Developer technologies | ASP.NET | Other
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

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