Implement sign in (Login) using Azure Active Directory in ASP.Net

anjali600
 
on Nov 08, 2021 01:48 AM
525 Views

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. 

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

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);
    }
}

Any help will be appreciated.

Download FREE API for Word, Excel and PDF in ASP.Net: Download