Skip to content

Client Access Resource

nov edited this page Oct 8, 2022 · 2 revisions

Access Token Instance

If you obtain the instance via client.access_token! (Obtain Access Token), you already has Rack::OAuth2::AccessToken instance.

Otherwise, you'll need instantiate it from stringified access token.

Bearer Token

access_token = Rack::OAuth2::AccessToken::Bearer.new(
  access_token: 'a105a71a4071f7faa3b...'
)

Resource Request

access_token.get 'https://resource.server.example.com/me'

access_token delegates get, post, put and delete to Faraday::Connection instance. Read Faraday documents for details. https://github.com/lostisland/faraday