Commit 45937c0
Changed files (1)
bin
bin/idp
@@ -341,12 +341,17 @@ module Authz
iat: now,
nbf: now,
jti: SecureRandom.uuid,
+ exp: now + 3600,
}.merge(claims)
end
+ def [](claim)
+ claims.fetch(claim)
+ end
+
def active?
- # TODO:: check if current time is within valid range
- true
+ now = Time.now.to_i
+ self[:nbf] <= now && now < self[:exp]
end
def to_jwt