Skip to content

Commit

Permalink
fix: revert float64 auth_time claim (#599)
Browse files Browse the repository at this point in the history
Closes #598
  • Loading branch information
narg95 committed May 23, 2021
1 parent d022bbc commit e609d91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion token/jwt/claims_id_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (c *IDTokenClaims) ToMap() map[string]interface{} {
}

if !c.AuthTime.IsZero() {
ret["auth_time"] = float64(c.AuthTime.Unix()) // jwt-go does not support int64 as datatype
ret["auth_time"] = c.AuthTime.Unix()
} else {
delete(ret, "auth_time")
}
Expand Down
4 changes: 2 additions & 2 deletions token/jwt/claims_id_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestIDTokenClaimsToMap(t *testing.T) {
"baz": idTokenClaims.Extra["baz"],
"at_hash": idTokenClaims.AccessTokenHash,
"c_hash": idTokenClaims.CodeHash,
"auth_time": float64(idTokenClaims.AuthTime.Unix()),
"auth_time": idTokenClaims.AuthTime.Unix(),
"acr": idTokenClaims.AuthenticationContextClassReference,
"amr": idTokenClaims.AuthenticationMethodsReference,
}, idTokenClaims.ToMap())
Expand All @@ -88,7 +88,7 @@ func TestIDTokenClaimsToMap(t *testing.T) {
"baz": idTokenClaims.Extra["baz"],
"at_hash": idTokenClaims.AccessTokenHash,
"c_hash": idTokenClaims.CodeHash,
"auth_time": float64(idTokenClaims.AuthTime.Unix()),
"auth_time": idTokenClaims.AuthTime.Unix(),
"acr": idTokenClaims.AuthenticationContextClassReference,
"amr": idTokenClaims.AuthenticationMethodsReference,
"nonce": idTokenClaims.Nonce,
Expand Down

0 comments on commit e609d91

Please sign in to comment.