/// <summary> /// Generate passcode and fire it through MultifactorAuthenticate event. /// </summary> /// <param name="user">User info.</param> public string GeneratePasscode(UserInfo user) { MFAuthenticationHelper.IssuePasscode(user.UserName); if (MembershipContext.MFAuthenticationTokenNotInitialized && MFAuthenticationHelper.DisplaySetupCode) { var sb = new StringBuilder("missingToken|"); sb.Append(GetString("mfauthentication.isRequired"), " ", GetString("mfauthentication.token.get"), ARGUMENTS_SEPARATOR, GetString("mfauthentication.label.token"), ARGUMENTS_SEPARATOR, MFAuthenticationHelper.GetSetupCodeForUser(user.UserName)); return(sb.ToString()); } return("waitingForPasscode"); }