Ejemplo n.º 1
0
        public async Task <IActionResult> SSO(string returnUrl)
        {
            if (EcpState.IsLogin() == false)
            {
                string   auth  = HttpContext.Request.Headers["Authorization"];
                EcpState state = await _identityServer.InspurIdSSO(auth);

                EcpState.SetCurrent(state);
            }
            return(new RedirectResult(returnUrl));
        }
Ejemplo n.º 2
0
 protected StateController()
     : base()
 {
     try
     {
         if (EcpState.IsLogin() != true)
         {
             IIdentityServer server = NServiceProvider.GetService <IIdentityServer>();
             string          auth   = HttpContextProvider.Current.Request.Headers["Authorization"];
             EcpState        state  = server.InspurIdSSO(auth).Result;
             EcpState.SetCurrent(state);
         }
     }
     catch (Exception ex)
     {
         throw new ForbidException(ex.Message, ex);
     }
 }