asp.net Web application signing in Azure Active Directory

Anjali Agarwal 1,366 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.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,243 questions
C#
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.
10,197 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,380 questions
{count} votes