Class: OmniAuth::Auth0::JWTToken
- Inherits:
-
Object
- Object
- OmniAuth::Auth0::JWTToken
- Defined in:
- lib/omniauth/auth0/jwt_token.rb
Overview
JWTToken class to generate a JWT token for client assertion as per the OAuth 2.0 Client Credentials Grant specification.
Instance Attribute Summary collapse
-
#client_assertion_signing_algorithm ⇒ Object
readonly
Returns the value of attribute client_assertion_signing_algorithm.
-
#client_assertion_signing_key ⇒ Object
readonly
Returns the value of attribute client_assertion_signing_key.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#domain_url ⇒ Object
readonly
Returns the value of attribute domain_url.
Instance Method Summary collapse
-
#initialize(client_id, domain_url, client_assertion_signing_key, client_assertion_signing_algorithm = nil) ⇒ JWTToken
constructor
A new instance of JWTToken.
- #jwt_token ⇒ Object
Constructor Details
#initialize(client_id, domain_url, client_assertion_signing_key, client_assertion_signing_algorithm = nil) ⇒ JWTToken
Returns a new instance of JWTToken.
13 14 15 16 17 18 |
# File 'lib/omniauth/auth0/jwt_token.rb', line 13 def initialize(client_id, domain_url, client_assertion_signing_key, client_assertion_signing_algorithm = nil) @client_id = client_id @domain_url = domain_url @client_assertion_signing_key = client_assertion_signing_key @client_assertion_signing_algorithm = client_assertion_signing_algorithm || 'RS256' end |
Instance Attribute Details
#client_assertion_signing_algorithm ⇒ Object (readonly)
Returns the value of attribute client_assertion_signing_algorithm.
11 12 13 |
# File 'lib/omniauth/auth0/jwt_token.rb', line 11 def client_assertion_signing_algorithm @client_assertion_signing_algorithm end |
#client_assertion_signing_key ⇒ Object (readonly)
Returns the value of attribute client_assertion_signing_key.
11 12 13 |
# File 'lib/omniauth/auth0/jwt_token.rb', line 11 def client_assertion_signing_key @client_assertion_signing_key end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
11 12 13 |
# File 'lib/omniauth/auth0/jwt_token.rb', line 11 def client_id @client_id end |
#domain_url ⇒ Object (readonly)
Returns the value of attribute domain_url.
11 12 13 |
# File 'lib/omniauth/auth0/jwt_token.rb', line 11 def domain_url @domain_url end |
Instance Method Details
#jwt_token ⇒ Object
20 21 22 |
# File 'lib/omniauth/auth0/jwt_token.rb', line 20 def jwt_token JWT.encode(jwt_payload, client_assertion_signing_key, client_assertion_signing_algorithm) end |