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 }; }
public static void Logoff(Token entity) { try { AuthManager.DisposeToken(entity.oauth_token); } catch (Exception ex) { // do nothing } }
public GetResponse<Token> RefreshToken(Token entity) { return new GetResponse<Token>() { Entity = AuthRepository.RefreshToken(entity) }; }
public void Logoff(Token entity) { var cookie = new HttpCookie("_mpcc", string.Empty); HttpContext.Current.Response.SetCookie(cookie); AuthRepository.Logoff(entity); }