Class: AadAuth::Aad
- Inherits:
-
Object
- Object
- AadAuth::Aad
- Defined in:
- lib/aad_auth.rb
Instance Method Summary collapse
Instance Method Details
#auth!(token) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/aad_auth.rb', line 8 def auth!(token) keys = self.get_jwk_set() jwk_loader = ->() do @cached_keys = nil if [:invalidate] @cached_keys ||= keys end claims = JWT.decode(token, nil, true, { algorithm: 'RS256', jwks: jwk_loader }) self.validate_exp(claims[0]["exp"]) self.validate_aud(claims[0]["aud"]) end |