Class: Warden::WebAuthn::Strategy
- Inherits:
-
Strategies::Base
- Object
- Strategies::Base
- Warden::WebAuthn::Strategy
- Includes:
- StrategyHelpers
- Defined in:
- lib/warden/webauthn/strategy.rb
Overview
The core strategy for WebAuthn authentication in Warden
Instance Method Summary collapse
-
#authenticate! ⇒ Object
rubocop:enable Lint/UnreachableCode.
-
#valid? ⇒ Boolean
rubocop:disable Lint/UnreachableCode.
Methods included from StrategyHelpers
#authentication_challenge, #authentication_challenge_key, #credential_finder, #credential_finder_key, #delete_authentication_challenge, #parsed_credential, #raw_credential, #raw_credential_key, #relying_party, #verify_authentication_and_find_stored_credential
Methods included from RackHelpers
#relying_party_key, #set_relying_party_in_request_env
Instance Method Details
#authenticate! ⇒ Object
rubocop:enable Lint/UnreachableCode
20 21 22 23 24 25 26 |
# File 'lib/warden/webauthn/strategy.rb', line 20 def authenticate! stored_credential = verify_authentication_and_find_stored_credential return if stored_credential.nil? success!(stored_credential.user) end |
#valid? ⇒ Boolean
rubocop:disable Lint/UnreachableCode
12 13 14 15 16 17 |
# File 'lib/warden/webauthn/strategy.rb', line 12 def valid? return true unless parsed_credential.nil? fail(:credential_missing_or_could_not_be_parsed) false end |