/// <summary>
        /// Returns AssertionOptions including a challenge to the browser/authr to assert existing credentials and authenticate a user.
        /// </summary>
        /// <returns></returns>
        public AssertionOptions GetAssertionOptions(IEnumerable <PublicKeyCredentialDescriptor> allowedCredentials, UserVerificationRequirement?userVerification, AuthenticationExtensionsClientInputs extensions = null)
        {
            var challenge = new byte[Config.ChallengeSize];

            _crypto.GetBytes(challenge);

            var options = AssertionOptions.Create(Config, challenge, allowedCredentials, userVerification, extensions);

            return(options);
        }
Exemple #2
0
        /// <summary>
        /// Returns AssertionOptions including a challenge to the browser/authr to assert existing credentials and authenticate a user.
        /// </summary>
        /// <returns></returns>
        public AssertionOptions GetAssertionOptions(
            IEnumerable <PublicKeyCredentialDescriptor> allowedCredentials,
            UserVerificationRequirement?userVerification,
            AuthenticationExtensionsClientInputs?extensions = null)
        {
            var challenge = new byte[_config.ChallengeSize];

            RandomNumberGenerator.Fill(challenge);

            var options = AssertionOptions.Create(_config, challenge, allowedCredentials, userVerification, extensions);

            return(options);
        }