示例#1
0
 public AuthenticationResult FinishLoginWithSecurePhraseAnswer(string token, SecurePhraseAnswer answer)
 {
     if (!_tokens.ContainsKey(token)) throw new InvalidSecurePhraseAnswer();
     var user = _tokens[token];
     var newToken = Guid.NewGuid().ToString();
     _tokens.Remove(token);
     _tokens.Add(newToken, user);
     return new AuthenticationResult
     {
         Role = user.Role,
         SecurityToken = newToken,
     };
 }
 private User FinishUserLogin(string securityToken, SecurePhraseAnswer securePhraseAnswer)
 {
     return this.Authentication.Login(securityToken, securePhraseAnswer);
 }
 public User Login(string securityToken, SecurePhraseAnswer sequrePhraseAnswer)
 {
     var authResult = this._service.FinishLoginWithSecurePhraseAnswer(securityToken, sequrePhraseAnswer);
     return Login(authResult.SecurityToken);
 }