Sha256: a15e5ea8d2100d22f58c404aaf64c84ff79a6b79585e9cf17d46c3f621f60968
Contents?: true
Size: 725 Bytes
Versions: 11
Compression:
Stored size: 725 Bytes
Contents
require 'addressable/uri' module CASino module ProcessorConcern module TwoFactorAuthenticators class ValidationResult < CASino::ValidationResult; end def validate_one_time_password(otp, authenticator) if authenticator.nil? || authenticator.expired? ValidationResult.new 'INVALID_AUTHENTICATOR', 'Authenticator does not exist or expired', :warn else totp = ROTP::TOTP.new(authenticator.secret) if totp.verify_with_drift(otp, CASino.config.two_factor_authenticator[:drift]) ValidationResult.new else ValidationResult.new 'INVALID_OTP', 'One-time password not valid', :warn end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems