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

allow Numeric for iat field on OIDC tokens #4518

Merged
merged 2 commits into from Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/forms/openid_connect_token_form.rb
Expand Up @@ -128,7 +128,7 @@ def validate_aud_claim(payload)
def validate_iat(payload)
return true unless payload.key?('iat')
iat = payload['iat']
return true if iat.is_a?(Integer) && (iat.to_i - ISSUED_AT_LEEWAY_SECONDS) < Time.zone.now.to_i
return true if iat.is_a?(Numeric) && (iat.to_i - ISSUED_AT_LEEWAY_SECONDS) < Time.zone.now.to_i

errors.add(:client_assertion, t('openid_connect.token.errors.invalid_iat'))
end
Expand Down
4 changes: 2 additions & 2 deletions config/locales/openid_connect/en.yml
Expand Up @@ -28,8 +28,8 @@ en:
invalid_code: is invalid either because it expired, or it doesn't match any
user. Please see our documentation at https://developers.login.gov/oidc/#token
invalid_code_verifier: code_verifier did not match code_challenge
invalid_iat: iat must be an integer Unix timestamp representing a time in
the past
invalid_iat: iat must be an integer or floating point Unix timestamp representing
a time in the past
user_info:
errors:
malformed_authorization: Malformed Authorization header
Expand Down
4 changes: 2 additions & 2 deletions config/locales/openid_connect/es.yml
Expand Up @@ -28,8 +28,8 @@ es:
invalid_code: no es válido porque ha caducado o no coincide con ningún usuario.
Consulte nuestra documentación en https://developers.login.gov/oidc/#token
invalid_code_verifier: code_verifier no coincide con code_challenge
invalid_iat: iat debe ser una marca de tiempo entera de Unix que represente
un tiempo en el pasado
invalid_iat: iat debe ser una marca de tiempo Unix de punto flotante o entero
que represente un tiempo en el pasado
user_info:
errors:
malformed_authorization: Título de autorización mal formado
Expand Down
4 changes: 2 additions & 2 deletions config/locales/openid_connect/fr.yml
Expand Up @@ -29,8 +29,8 @@ fr:
ne correspond à aucun utilisateur. Veuillez consulter notre documentation
à https://developers.login.gov/oidc/#token
invalid_code_verifier: code_verifier ne correspondait pas à code_challenge
invalid_iat: iat doit être un horodatage Unix entier représentant une heure
dans le passé
invalid_iat: iat doit être un horodatage Unix entier ou à virgule flottante
représentant une heure dans le passé
user_info:
errors:
malformed_authorization: Forme de l'en-tête d'autorisation non valide
Expand Down