public void LoadToken(Token token, string returnUrl) { // If expiresOn is specified and token has expired, refresh token!! Currently, exception thrown! if (token.ExpiresOn != null && token.ExpiresOn != DateTime.MinValue) { if (token.ExpiresOn < DateTime.Now) { _logger.Error("Token has expired"); throw new OAuthException("Token has expired."); } } //If user is already connected with provider specified in token, ignore this request! if (SocialAuthUser.IsConnectedWith(token.Provider)) { return; } //Load token token.UserReturnURL = returnUrl; SessionManager.AddConnectionToken(token); //SetUserAsLoggedIn(); }
/// <summary> /// Called by Authentication Strategy at end of authentication process /// </summary> /// <param name="isSuccess">Is authentication successful</param> internal static void OnAuthneticationProcessCompleted(bool isSuccess, Token token) { SessionManager.AddConnectionToken(SessionManager.InProgressToken); //SetUserAsLoggedIn(); }