Skip to content

added userPresence check with userVerification = true #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2-stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions spec/webauthn/authenticator_assertion_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@
end
end

describe "user present validation 2" do
let(:assertion) { client.get(challenge: original_challenge, user_present: false, user_verified: true) }

context "if user flags are off" do
it "doesn't verify" do
expect {
assertion_response.verify(original_challenge, public_key: credential_public_key, sign_count: 0)
}.to raise_exception(WebAuthn::UserPresenceVerificationError)
end

it "is invalid" do
expect(
assertion_response.valid?(original_challenge, public_key: credential_public_key, sign_count: 0)
).to be_falsy
end
end
end

describe "user verified validation" do
context "if user flags are off" do
let(:assertion) { client.get(challenge: original_challenge, user_present: true, user_verified: false) }
Expand Down