Class: Devise::Strategies::PKCS12Authenticatable
- Inherits:
-
DatabaseAuthenticatable
- Object
- DatabaseAuthenticatable
- Devise::Strategies::PKCS12Authenticatable
- Defined in:
- lib/devise_pkcs12_authenticatable/strategy.rb
Instance Method Summary collapse
-
#authenticate! ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Lint/AssignmentInCondition,Style/Semicolon,Metrics/LineLength.
-
#valid? ⇒ Boolean
rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity,Lint/AssignmentInCondition,Style/Semicolon,Metrics/LineLength.
Instance Method Details
#authenticate! ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Lint/AssignmentInCondition,Style/Semicolon,Metrics/LineLength
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/devise_pkcs12_authenticatable/strategy.rb', line 9 def authenticate! opts = authentication_hash.merge(Hash[::Devise.pkcs12_common_name_field, common_name]) resource = password.present? && mapping.to.find_for_pkcs12_authentication(opts) encrypted = false if validate(resource) { encrypted = true; resource.valid_password?(password) } && resource.valid_common_name?(common_name) remember_me(resource) resource.after_database_authentication success!(resource) end mapping.to.new.password = password if !encrypted && Devise.paranoid fail!(:not_found_in_database) unless resource end |
#valid? ⇒ Boolean
rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity,Lint/AssignmentInCondition,Style/Semicolon,Metrics/LineLength
26 27 28 |
# File 'lib/devise_pkcs12_authenticatable/strategy.rb', line 26 def valid? super && client_verify? end |