Class: OpenIDConnect::AccessToken

Inherits:
Rack::OAuth2::AccessToken::Bearer
  • Object
show all
Defined in:
lib/openid_connect/access_token.rb

Direct Known Subclasses

MTLS

Defined Under Namespace

Classes: MTLS

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AccessToken

Returns a new instance of AccessToken.



6
7
8
9
# File 'lib/openid_connect/access_token.rb', line 6

def initialize(attributes = {})
  super
  @token_type = :bearer
end

Instance Method Details

#to_mtls(attributes = {}) ⇒ Object



18
19
20
21
22
23
# File 'lib/openid_connect/access_token.rb', line 18

def to_mtls(attributes = {})
  (required_attributes + optional_attributes).each do |key|
    attributes[key] = self.send(key)
  end
  MTLS.new attributes
end

#userinfo!(params = {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/openid_connect/access_token.rb', line 11

def userinfo!(params = {})
  hash = resource_request do
    get client.userinfo_uri, params
  end
  ResponseObject::UserInfo.new hash
end