示例#1
0
 public ChallengeModel(User user, U2fRegistration registration)
 {
     UserId    = user.Id.ToString();
     AppId     = registration.AppId;
     Challenge = registration.Challenge;
     Version   = registration.Version;
 }
示例#2
0
        public TwoFactorU2fResponseModel(User user, TwoFactorProvider provider, U2fRegistration registration = null)
            : base("twoFactorU2f")
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            if (registration != null)
            {
                Challenge = new ChallengeModel(user, registration);
            }
            Enabled = provider?.Enabled ?? false;
        }