Class: Rack::OAuth2::AccessToken::Bearer

Inherits:
Rack::OAuth2::AccessToken show all
Defined in:
lib/rack/oauth2/access_token/bearer.rb

Direct Known Subclasses

MTLS

Instance Attribute Summary

Attributes inherited from Rack::OAuth2::AccessToken

#raw_attributes

Instance Method Summary collapse

Methods inherited from Rack::OAuth2::AccessToken

#http_client, #initialize, #token_response

Constructor Details

This class inherits a constructor from Rack::OAuth2::AccessToken

Instance Method Details

#authenticate(request) ⇒ Object



5
6
7
# File 'lib/rack/oauth2/access_token/bearer.rb', line 5

def authenticate(request)
  request.headers["Authorization"] = "Bearer #{access_token}"
end

#to_mtls(attributes = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/rack/oauth2/access_token/bearer.rb', line 9

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