Class: ADAL::ClientAssertion
- Inherits:
-
Object
- Object
- ADAL::ClientAssertion
- Includes:
- RequestParameters, TokenRequest::GrantType, Util
- Defined in:
- lib/adal/client_assertion.rb
Overview
A client credential that consists of the client id and a JWT bearer assertion. The type is ‘urn:ietf:params:oauth:token-type:jwt’.
Constant Summary
Constants included from RequestParameters
RequestParameters::AAD_API_VERSION, RequestParameters::ASSERTION, RequestParameters::CLIENT_ASSERTION, RequestParameters::CLIENT_ASSERTION_TYPE, RequestParameters::CLIENT_ID, RequestParameters::CLIENT_REQUEST_ID, RequestParameters::CLIENT_RETURN_CLIENT_REQUEST_ID, RequestParameters::CLIENT_SECRET, RequestParameters::CODE, RequestParameters::FORM_POST, RequestParameters::GRANT_TYPE, RequestParameters::PASSWORD, RequestParameters::REDIRECT_URI, RequestParameters::REFRESH_TOKEN, RequestParameters::RESOURCE, RequestParameters::SCOPE, RequestParameters::UNIQUE_ID, RequestParameters::USERNAME, RequestParameters::USER_INFO
Constants included from TokenRequest::GrantType
TokenRequest::GrantType::AUTHORIZATION_CODE, TokenRequest::GrantType::CLIENT_CREDENTIALS, TokenRequest::GrantType::JWT_BEARER, TokenRequest::GrantType::PASSWORD, TokenRequest::GrantType::REFRESH_TOKEN, TokenRequest::GrantType::SAML1, TokenRequest::GrantType::SAML2
Instance Attribute Summary collapse
-
#assertion ⇒ Object
readonly
Returns the value of attribute assertion.
-
#assertion_type ⇒ Object
readonly
Returns the value of attribute assertion_type.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
Instance Method Summary collapse
-
#initialize(client_id, assertion, assertion_type = JWT_BEARER) ⇒ ClientAssertion
constructor
Creates a new ClientAssertion.
-
#request_params ⇒ Object
The relavent parameters from this credential for OAuth.
Methods included from Util
#fail_if_arguments_nil, #http, #string_hash
Constructor Details
#initialize(client_id, assertion, assertion_type = JWT_BEARER) ⇒ ClientAssertion
Creates a new ClientAssertion.
46 47 48 49 50 51 |
# File 'lib/adal/client_assertion.rb', line 46 def initialize(client_id, assertion, assertion_type = JWT_BEARER) fail_if_arguments_nil(client_id, assertion, assertion_type) @assertion = assertion @assertion_type = assertion_type @client_id = client_id end |
Instance Attribute Details
#assertion ⇒ Object (readonly)
Returns the value of attribute assertion.
35 36 37 |
# File 'lib/adal/client_assertion.rb', line 35 def assertion @assertion end |
#assertion_type ⇒ Object (readonly)
Returns the value of attribute assertion_type.
36 37 38 |
# File 'lib/adal/client_assertion.rb', line 36 def assertion_type @assertion_type end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
37 38 39 |
# File 'lib/adal/client_assertion.rb', line 37 def client_id @client_id end |
Instance Method Details
#request_params ⇒ Object
The relavent parameters from this credential for OAuth.
57 58 59 60 61 |
# File 'lib/adal/client_assertion.rb', line 57 def request_params { CLIENT_ID => @client_id, CLIENT_ASSERTION_TYPE => @assertion_type, CLIENT_ASSERTION => @assertion } end |