Пример #1
0
 public AuthResponse ActivateTotpFactor(string stateToken, AuthResponse authResponse, string passCode)
 {
     var apiObject = new ApiObject();
     apiObject.SetProperty("passCode", passCode);
     var nextLink = authResponse.Links["next"].First();
     return Execute(stateToken, nextLink, apiObject);
 }
Пример #2
0
 private ActionResult CreateSessionFor(AuthResponse response)
 {
     if (response.Status != AuthStatus.Success)
     {
         throw new Exception("Unexpected error when validating MFA");
     }
     var username = response.Embedded.User.Profile.Login;
     var createPersistentCookie = true;
     FormsAuthentication.SetAuthCookie(username, createPersistentCookie);
     // Store the most recent response in the session
     Session[oktaResponseKey] = response;
     return RedirectToAction("CompleteMfa", "Account");
 }