Class: ADAL::UserAssertion

Inherits:
Object
  • Object
show all
Defined in:
lib/adal/user_assertion.rb

Overview

An assertion and its representation type, stored as a JWT for the on-behalf-of flow.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assertion, assertion_type = ADAL::TokenRequest::GrantType::JWT_BEARER) ⇒ UserAssertion

Creates a new UserAssertion.

Parameters:

  • String

    assertion An OAuth assertion representing the user.



40
41
42
43
44
# File 'lib/adal/user_assertion.rb', line 40

def initialize(
  assertion, assertion_type = ADAL::TokenRequest::GrantType::JWT_BEARER)
  @assertion = assertion
  @assertion_type = assertion_type
end

Instance Attribute Details

#assertionObject (readonly)

Returns the value of attribute assertion.



29
30
31
# File 'lib/adal/user_assertion.rb', line 29

def assertion
  @assertion
end

#assertion_typeObject (readonly)

Returns the value of attribute assertion_type.



30
31
32
# File 'lib/adal/user_assertion.rb', line 30

def assertion_type
  @assertion_type
end

Instance Method Details

#request_paramsObject

The relevant OAuth access token request parameters for this object.

Returns:

  • Hash



50
51
52
53
54
55
# File 'lib/adal/user_assertion.rb', line 50

def request_params
  { grant_type: assertion_type,
    assertion: assertion,
    requested_token_use: :on_behalf_of,
    scope: :openid }
end