Skip to content

Commit

Permalink
Update u2f_migration.md
Browse files Browse the repository at this point in the history
Update the example code to represent changes in the API of the `WebAuthn::AuthenticatorAssertionResponse` class
  • Loading branch information
jdongelmans committed Jan 19, 2022
1 parent 3d25ba7 commit cff7419
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/u2f_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ During authentication verification phase, you must pass either the original AppI
```ruby
assertion_response = WebAuthn::AuthenticatorAssertionResponse.new(
credential_id: params[:id],
user_handle: params[:response][:userHandle],
authenticator_data: params[:response][:authenticatorData],
client_data_json: params[:response][:clientDataJSON],
signature: params[:response][:signature],
)

assertion_response.verify(
expected_challenge,
allowed_credentials: [credential],
public_key: credential.public_key,
sign_count: credential.count,
rp_id: params[:clientExtensionResults][:appid] ? domain.to_s : domain.host,
)
```

0 comments on commit cff7419

Please sign in to comment.