Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.
/ signet Public archive
forked from googleapis/signet

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

License

Notifications You must be signed in to change notification settings

strchives/signet

 
 

Repository files navigation

Signet

Homepage
http://code.google.com/p/oauth-signet/
Author
Bob Aman
Copyright
Copyright © 2010 Google, Inc.
License
Apache 2.0

Gem Version Build Status

Description

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

Reference

  • {Signet::OAuth1}
  • {Signet::OAuth1::Client}
  • {Signet::OAuth1::Credential}
  • {Signet::OAuth1::Server}
  • {Signet::OAuth2}
  • {Signet::OAuth2::Client}

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

redirect_to(client.authorization_uri)

Obtain an access token

client.code = request.query['code']
client.fetch_access_token!

Install

gem install signet

Be sure https://rubygems.org is in your gem sources.

About

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 99.3%
  • Other 0.7%