protected void Page_Load(object sender, EventArgs e) { if (Request.IsAuthenticated) { String str = String.Empty; var qry = ((System.Security.Claims.ClaimsPrincipal)Request.RequestContext.HttpContext.User).Claims; if (null != qry) { foreach (System.Security.Claims.Claim item in qry) { if (item.Type == "preferred_username") { str = item.Value; } } } }else if (!Request.IsAuthenticated && Request.Form.Count > 0) { HttpContext.Current.GetOwinContext().Authentication.Challenge( new AuthenticationProperties { }, OpenIdConnectAuthenticationDefaults.AuthenticationType); } else { HttpContext.Current.GetOwinContext().Authentication.Challenge( new AuthenticationProperties { RedirectUri = "/XXXapp locationXXX/" }, OpenIdConnectAuthenticationDefaults.AuthenticationType); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)