Class: OmniAuth::Jwt::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/jwt/parser.rb

Constant Summary collapse

DEFAULT_ALG =
'RS256'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, client:) ⇒ Parser

Returns a new instance of Parser.



9
10
11
12
# File 'lib/omniauth/jwt/parser.rb', line 9

def initialize(token, client:)
  @token = token
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/omniauth/jwt/parser.rb', line 7

def client
  @client
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/omniauth/jwt/parser.rb', line 7

def token
  @token
end

Instance Method Details

#validated_payloadObject



14
15
16
# File 'lib/omniauth/jwt/parser.rb', line 14

def validated_payload
  ::JWT.decode(token, nil, true, jwks: jwks, algorithms: algorithms).first
end