示例#1
0
 public static Token RefreshToken(Token entity)
 {
     var principal = AuthManager.GetPrincipal(entity.oauth_token);
     var token = AuthManager.GenerateToken(principal.EnterpriseID, principal.BusinessUnitID, principal.MemberID,
                                           principal.ProviderUserKey, string.Empty, string.Empty);
     AuthManager.DisposeToken(entity.oauth_token);
     return new Token() { oauth_timestamp = DateTime.Now.ToString(), oauth_token = token };
 }
示例#2
0
 public static void Logoff(Token entity)
 {
     try
     {
         AuthManager.DisposeToken(entity.oauth_token);
     }
     catch (Exception ex)
     {
         // do nothing
     }
 }
示例#3
0
文件: Auth.cs 项目: MPCC/MPCC
 public GetResponse<Token> RefreshToken(Token entity)
 {
     return new GetResponse<Token>() { Entity = AuthRepository.RefreshToken(entity) };
 }
示例#4
0
文件: Auth.cs 项目: MPCC/MPCC
 public void Logoff(Token entity)
 {
     var cookie = new HttpCookie("_mpcc", string.Empty);
     HttpContext.Current.Response.SetCookie(cookie);
     AuthRepository.Logoff(entity);
 }