Socket
Book a DemoInstallSign in
Socket

two-legged-oauth

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

two-legged-oauth

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Two Legged OAuth

  • https://github.com/fraudpointer/two-legged-oauth-ruby

Description

The purpose of this gem is to make the oauth gem play nice with Google's custom 2 legged OAuth (2LO), used specifically for Google Apps APIs accessed from Google Apps Marketplace applications.

For more info on the 2 legged OAuth see these :

This gem has been tested with the following libraries so far and seems to be working ok :

Installation

Bundler

Add on your Gemfile :

gem 'two-legged-oauth'

By hand

On the console :

gem install two-legged-oauth

On your code :

require 'two-legged-oauth'

Usage

# Create a normal consumer instance
oauth_consumer = OAuth::Consumer.new("key", "secret")

# Initialize a TwoLeggedAccessToken specifying the xoauth_requestor_id
access_token = OAuth::TwoLeggedAccessToken.new(oauth_consumer, "user@domain.com")

# Pass that access token to Google Data libraries (or your custom scripts)
gs = GoogleSpreadsheet.login_with_oauth(access_token)

Internals

This thing works by rewriting the requested URL on-the-fly and appends the xoauth_requestor_id param appropriately. This may be dangerous at times so be aware that some well hidden bugs may come up...

Bugs/fixes

Report any issues on the github's issue tracker or send a pull request if you have nailed the bug.

Contributing

Tested contributions are always welcome! Here's what you should do:

  • Clone the repo
  • Run the tests
  • Write some test-driven code
  • Create a pull request

License

two-legged-oauth is copyright 2011 by Fraudpointer, released under the MIT License (see LICENSE for details).

FAQs

Package last updated on 04 Sep 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.