class

OAuth2::AccessToken

Inherits Reference / Object

Base class for the two possible access tokens: Bearer and Mac.

Use #authenticate to authenticate an HTTP::Client.

Constructors

new(access_token : String, expires_in : Int | Nil, refresh_token : String | Nil = nil, scope : String | Nil = nil, extra : Nil | Hash(String, String) = nil)
Source
new(pull : JSON::PullParser) : self
Source

Instance methods

access_token
Source
access_token=(access_token : String)
Source
authenticate(request : HTTP::Request, tls)
Source
authenticate(client : HTTP::Client)
Source
expires_in
Source
expires_in=(expires_in : Int64 | Nil)
Source
extra

JSON key-value pairs that are outside of the OAuth2 spec are stored in this property in case they are needed. Their value is the raw JSON string found in the JSON value (with possible changes in the string format, but preserving JSON semantic). For example if the value was [1, 2, 3] then the value in this hash will be the string "[1,2,3]".

Source
extra=(extra : Hash(String, String) | Nil)

JSON key-value pairs that are outside of the OAuth2 spec are stored in this property in case they are needed. Their value is the raw JSON string found in the JSON value (with possible changes in the string format, but preserving JSON semantic). For example if the value was [1, 2, 3] then the value in this hash will be the string "[1,2,3]".

Source
refresh_token
Source
refresh_token=(refresh_token : String | Nil)
Source
scope
Source
scope=(scope : String | Nil)
Source

Nested types