Class: OmniAuth::Fishbrain::DecodeIdToken
- Inherits:
-
Object
- Object
- OmniAuth::Fishbrain::DecodeIdToken
- Includes:
- Jwks
- Defined in:
- lib/omniauth/fishbrain/decode_id_token.rb
Constant Summary collapse
- AWS_REGION =
'eu-west-1'- USER_POOL_ID =
'eu-west-1_TKWveIcYu'
Instance Attribute Summary collapse
-
#aws_region ⇒ Object
readonly
Returns the value of attribute aws_region.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#jwt_leeway ⇒ Object
readonly
Returns the value of attribute jwt_leeway.
-
#user_pool_id ⇒ Object
readonly
Returns the value of attribute user_pool_id.
Instance Method Summary collapse
- #decode(raw_id_token) ⇒ Object
-
#initialize(client_id, user_pool_id = USER_POOL_ID, aws_region = AWS_REGION) ⇒ DecodeIdToken
constructor
A new instance of DecodeIdToken.
Methods included from Jwks
Constructor Details
#initialize(client_id, user_pool_id = USER_POOL_ID, aws_region = AWS_REGION) ⇒ DecodeIdToken
16 17 18 19 20 21 |
# File 'lib/omniauth/fishbrain/decode_id_token.rb', line 16 def initialize(client_id, user_pool_id = USER_POOL_ID, aws_region = AWS_REGION) @client_id = client_id @user_pool_id = user_pool_id @aws_region = aws_region @jwt_leeway = 60 end |
Instance Attribute Details
#aws_region ⇒ Object (readonly)
Returns the value of attribute aws_region.
14 15 16 |
# File 'lib/omniauth/fishbrain/decode_id_token.rb', line 14 def aws_region @aws_region end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
14 15 16 |
# File 'lib/omniauth/fishbrain/decode_id_token.rb', line 14 def client_id @client_id end |
#jwt_leeway ⇒ Object (readonly)
Returns the value of attribute jwt_leeway.
14 15 16 |
# File 'lib/omniauth/fishbrain/decode_id_token.rb', line 14 def jwt_leeway @jwt_leeway end |
#user_pool_id ⇒ Object (readonly)
Returns the value of attribute user_pool_id.
14 15 16 |
# File 'lib/omniauth/fishbrain/decode_id_token.rb', line 14 def user_pool_id @user_pool_id end |
Instance Method Details
#decode(raw_id_token) ⇒ Object
23 24 25 |
# File 'lib/omniauth/fishbrain/decode_id_token.rb', line 23 def decode(raw_id_token) JWT.decode(raw_id_token, nil, true, ).first end |