Google::Auth::OAuth2Client
OAuth2 client for Google API authentication. Supports authorization code flow, token refresh, and credential persistence.
oauth = Google::Auth::OAuth2Client.new(client_id, client_secret)
url = oauth.authorization_url(scope: Google::Auth::Scopes::YOUTUBE)
# User visits URL, gets code
oauth.authorize(code)
Constants
GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth"
GOOGLE_TOKEN_URL = "oauth2.googleapis.com"
TOKEN_PATH = "/token"
Constructors
Instance methods
access_token
Sourceauthorization_url(scope : String | Array(String), state : String | Nil = nil, access_type : String = "offline", prompt : String = "consent") : String
Generate the authorization URL for the user to visit
client_id
Sourceclient_secret
Sourceexpires_at
Sourceredirect_uri
Sourcerefresh_token
Source