/// <summary> /// ConfirmUserSession requie cal method CheckPassword before. /// </summary> /// <returns></returns> public string ConfirmUserSession(IServiceContext serviceContext, User user) { var token = Guid.NewGuid().ToString(); UserAuthenticationCache.PutUser(serviceContext, user, token); return(token); }
public void TryAuthorise() { if (userToken != null && userToken.Trim() != String.Empty) { var user = UserAuthenticationCache.GetUser(this, userToken); if (user != null) { //TODO: Create converter. var autorisedUser = new UserSession() { UserId = user.UserId, UserName = user.Login, }; this._user = autorisedUser; } } }