GithubHelp home page GithubHelp logo

isabella232 / signet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/signet

0.0 0.0 0.0 717 KB

Signet is an OAuth 1.0 / OAuth 2.0 implementation.

License: Apache License 2.0

Ruby 99.09% Shell 0.15% HTML 0.50% Batchfile 0.26%

signet's Introduction

Signet

Homepage
https://github.com/googleapis/signet/
Author
Bob Aman
Copyright
Copyright © 2010 Google, Inc.
License
Apache 2.0

Gem Version

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.

Supported Ruby Versions

This library requires Ruby 2.4 or later. In general, this library supports 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.

signet's People

Contributors

analogj avatar andirayo avatar blowmage avatar cc avatar chutzimir avatar dazuma avatar dwsupplee avatar edwardbetts avatar fdhadzh avatar foxtacles avatar jas14 avatar jashenson avatar jurriaan avatar justinbeckwith avatar koic avatar lestopher avatar manuelmeurer avatar mechazoidal avatar momer avatar nevir avatar saiqulhaq avatar sanemat avatar senid231 avatar seuros avatar sporkmonger avatar sqrrrl avatar theroyaltnetennba avatar wyaeld avatar ylecuyer avatar ysksn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.