- Bob Aman
- Copyright © 2010 Google, Inc.
- Apache 2.0
Signet is an OAuth 1.0 / OAuth 2.0 implementation.
Example Usage for Google
Initialize the client
require 'signet/oauth_2/client' client = Signet::OAuth2::Client.new( :authorization_uri => 'https://accounts.google.com/o/oauth2/auth', :token_credential_uri => 'https://oauth2.googleapis.com/token', :client_id => '44410190108-74nkm6jc5e3vvjqis803frkvmu88cu3a.apps.googleusercontent.com', :client_secret => 'X1NUhvO-rQr9sm8uUSMY8i7v', :scope => 'email profile', :redirect_uri => 'https://example.client.com/oauth' )
Request an authorization code
Obtain an access token
client.code = request.query['code'] client.fetch_access_token!
gem install signet
https://rubygems.org is in your gem sources.
Supported Ruby Versions
This library is currently supported on Ruby 1.9+.
However, Ruby 2.4 or later is strongly recommended, as earlier releases have reached or are nearing end-of-life. After March 31, 2019, Google will provide official support only for Ruby versions that are considered current and supported by Ruby Core (that is, Ruby versions that are either in normal maintenance or in security maintenance). See https://www.ruby-lang.org/en/downloads/branches/ for further details.