Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
0
        public static bool IsLogin()
        {
            EcpState state = HttpContextProvider.Current.Session.Get <EcpState>(StateKey);

            return(state != null);
        }
Exemplo n.º 3
0
 public static void SetCurrent(EcpState state)
 {
     HttpContextProvider.Current.Session.Set(StateKey, state);
 }