class OAuth2::Session

Overview

An OAuth2 session makes it easy to implement APIs that need to refresh an access token once its expired before executing an HTTP request.

Superclass hierarchy

Object
Reference
OAuth2::Session

Defined in:

Class Method Summary

Instance Method Summary

Class Method Detail

def self.new(oauth2_client, access_token, expires_at = Time.utc_now, &callback : OAuth2::Session -> )

Creates an OAuth2::Session.

Params:


Instance Method Detail

def access_token

def authenticate(http_client)

Authenticates an HTTP::Client, refreshing the access token if it is expired.

Invoke this method on an HTTP::Client before executing an HTTP request.


def expires_at

def oauth2_client