kakamg0 / signet

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

Home Page:http://code.google.com/p/oauth-signet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Signet

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

Build Status Dependency 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

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

gem install signet

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

About

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

http://code.google.com/p/oauth-signet/

License:Apache License 2.0


Languages

Language:Ruby 99.4%Language:HTML 0.5%Language:Shell 0.1%