Skip to content
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

Documentation on how to generate values for context #6

Open
sbastn opened this issue May 11, 2022 · 0 comments
Open

Documentation on how to generate values for context #6

sbastn opened this issue May 11, 2022 · 0 comments

Comments

@sbastn
Copy link

sbastn commented May 11, 2022

Hello,

We're trying out your library and we're running into issues when generating values to build a context object. Specifically, any documentation on how to generate the following values would be great:

  • client_data_json
  • challenge

Could we help you document this in the Readme?

We're currently stuck at this step:

    challenge = 'random-string-generated-by-rp-server'

    client_data_json = Base64.urlsafe_encode64({
      type: "webauthn.create",
      challenge: challenge,
      origin: request.base_url,
    }.to_json, padding: false)
    
    context = WebAuthn.context_for(
      client_data_json, # NOTE: URL-safe Base64 encoded
      origin: request.base_url,
      challenge: challenge
    )

This fails with Invalid Challenge. We're testing this in localhost, do we need https for the origin to be valid?

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant