Class: AnswerLayer::IdentityBrokerResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/answerlayer/resources/identity_broker.rb

Constant Summary collapse

SUBJECT_TOKEN_TYPE =
"urn:ietf:params:oauth:token-type:jwt"

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from AnswerLayer::Resource

Instance Method Details

#exchange_token(subject_token:, subject_token_type: SUBJECT_TOKEN_TYPE) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/answerlayer/resources/identity_broker.rb', line 7

def exchange_token(subject_token:, subject_token_type: SUBJECT_TOKEN_TYPE)
  to_api_response(request(method: :post, path: "/oauth/token", auth: :oauth, form: {
    grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
    subject_token: subject_token,
    subject_token_type: subject_token_type
  }))
end

#jwksObject



15
16
17
# File 'lib/answerlayer/resources/identity_broker.rb', line 15

def jwks
  to_api_response(request(method: :get, path: "/.well-known/jwks.json", auth: :none))
end