Class: ADAL::SelfSignedJwtFactory
- Inherits:
-
Object
- Object
- ADAL::SelfSignedJwtFactory
- Includes:
- JwtParameters, Logging
- Defined in:
- lib/adal/self_signed_jwt_factory.rb
Overview
Converts client certificates into self signed JWTs.
Constant Summary
Constants included from Logging
Logging::DEFAULT_LOG_LEVEL, Logging::DEFAULT_LOG_OUTPUT
Constants included from JwtParameters
JwtParameters::ALGORITHM, JwtParameters::AUDIENCE, JwtParameters::EXPIRES_ON, JwtParameters::ISSUER, JwtParameters::JWT_ID, JwtParameters::NOT_BEFORE, JwtParameters::RS256, JwtParameters::SELF_SIGNED_JWT_LIFETIME, JwtParameters::SUBJECT, JwtParameters::THUMBPRINT, JwtParameters::TYPE, JwtParameters::TYPE_JWT
Instance Method Summary collapse
-
#create_and_sign_jwt(certificate, private_key) ⇒ Object
Creates a JWT from a client certificate and signs it with a private key.
-
#initialize(client_id, token_endpoint) ⇒ SelfSignedJwtFactory
constructor
Constructs a new SelfSignedJwtFactory.
Methods included from Logging
Constructor Details
#initialize(client_id, token_endpoint) ⇒ SelfSignedJwtFactory
Constructs a new SelfSignedJwtFactory.
43 44 45 46 |
# File 'lib/adal/self_signed_jwt_factory.rb', line 43 def initialize(client_id, token_endpoint) @client_id = client_id @token_endpoint = token_endpoint end |
Instance Method Details
#create_and_sign_jwt(certificate, private_key) ⇒ Object
Creates a JWT from a client certificate and signs it with a private key.
57 58 59 |
# File 'lib/adal/self_signed_jwt_factory.rb', line 57 def create_and_sign_jwt(certificate, private_key) JWT.encode(payload, private_key, RS256, header(certificate)) end |