Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Signet is an OAuth 1.0 / OAuth 2.0 implementation.

This branch is 9 commits ahead, 19 commits behind yakimaherald:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
tasks
website
.gitignore
CHANGELOG
LICENSE
README.md
Rakefile

README.md

Signet

Homepage
signet.rubyforge.org
Author
Bob Aman
Copyright
Copyright © 2010 Google, Inc.
License
Apache 2.0

Description

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

Reference

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

Example Usage for Google

require 'signet/oauth_1/client'
client = Signet::OAuth1::Client.new(
  :temporary_credential_uri =>
    'https://www.google.com/accounts/OAuthGetRequestToken',
  :authorization_uri =>
    'https://www.google.com/accounts/OAuthAuthorizeToken',
  :token_credential_uri =>
    'https://www.google.com/accounts/OAuthGetAccessToken',
  :client_credential_key => 'anonymous',
  :client_credential_secret => 'anonymous'
)
client.fetch_temporary_credential!(:additional_parameters => {
  :scope => 'https://mail.google.com/mail/feed/atom'
})
# Send the user to client.authorization_uri, obtain verifier
client.fetch_token_credential!(:verifier => '12345')
response = client.fetch_protected_resource(
  :uri => 'https://mail.google.com/mail/feed/atom'
)

Install

sudo gem install signet

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

Something went wrong with that request. Please try again.