Repository navigation
feat: add a signed challenge store that keeps no server state - #157
Closed
RenzoMinelli wants to merge 13 commits into
Closed
RenzoMinelli wants to merge 13 commits into
RenzoMinelli wants to merge 13 commits into
Conversation
RenzoMinelli
marked this pull request as draft
October 7, 2026 21:50
RenzoMinelli
added a commit
that referenced
this pull request
Oct 7, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Oct 8, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--signed-challenge-store
branch
from
October 8, 2026 21:57
def29c6 to
ec1c50e
Compare
RenzoMinelli
changed the base branch from
rm--cache-challenge-store
to
rm--api-two-factor
October 8, 2026 21:57
RenzoMinelli
added a commit
that referenced
this pull request
Oct 9, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--signed-challenge-store
branch
from
October 9, 2026 13:17
ec1c50e to
8172dfb
Compare
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Non-navigational requests get `201`/`204`, or `422` with an `error` message, instead of a redirect. Browsers still get redirects and flashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…llers `respond_with_navigational` keeps redirects and flashes for browsers. Other formats get `201` with the credential, `204`, or `422` with `errors`. A credential that fails validation now counts as a failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two-factor strategy reads the session in `valid?`, so the override has no effect for clients without a session until #154. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--api-two-factor
branch
from
October 9, 2026 20:30
7d54366 to
9d54958
Compare
… clients Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a password sign-in needs a second factor and the request is not navigational, respond `401` with a `two_factor_token`. The security key options and two-factor endpoints accept it in place of the session. Two-factor sign-in follows `skip_session_storage` (`:params_auth`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng sign-in Browsers keep the redirect, so the failure app does not store the two-factor page as the location to return to after sign-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`write` now returns the challenge the options controllers render. The credential lookup moves to `ChallengeStores::CredentialChallenge` so other stores can share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server signs each challenge with secret_key_base and checks the signature when the credential returns it in clientDataJSON. API clients need no session and no shared cache. A signed challenge can be reused until it expires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stays at 0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--api-two-factor
branch
from
October 9, 2026 20:53
9d54958 to
d1ad3e0
Compare
RenzoMinelli
force-pushed
the
rm--signed-challenge-store
branch
2 times, most recently
from
October 9, 2026 20:55
0811c70 to
b3ed7ec
Compare
RenzoMinelli
force-pushed
the
rm--api-two-factor
branch
2 times, most recently
from
October 13, 2026 18:02
16d3ee6 to
e57864a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Adds
ChallengeStores::Signed(:signed). The server signs each challenge withsecret_key_base. The client returns it inclientDataJSON, and the server checks the signature.writenow returns the challenge the options controllers send.Why:
:cacheneeds a cache shared by all servers.:signedkeeps no server state and needs nothing extra from the client. Stacked on #154.Trade-off: A signed challenge can be used more than once until it expires, like a challenge in a cookie session.
:cachestays for apps that need single use.How to test:
bundle exec rspec spec/devise/webauthn/challenge_stores/signed_spec.rb spec/requests/devise/api_client_spec.rb.