Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/googleapis/signet
Signet is an OAuth 1.0 / OAuth 2.0 implementation.
https://github.com/googleapis/signet
Last synced: about 8 hours ago
JSON representation
Signet is an OAuth 1.0 / OAuth 2.0 implementation.
- Host: GitHub
- URL: https://github.com/googleapis/signet
- Owner: googleapis
- License: apache-2.0
- Created: 2012-01-23T17:13:36.000Z (almost 13 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T17:59:40.000Z (about 2 months ago)
- Last Synced: 2024-12-24T12:51:12.110Z (9 days ago)
- Language: Ruby
- Homepage:
- Size: 829 KB
- Stars: 372
- Watchers: 57
- Forks: 164
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Signet
- Homepage
- https://github.com/googleapis/signet/
- Author
- Bob Aman
- Copyright
- Copyright © 2010 Google, Inc.
- License
- Apache 2.0
[![Gem Version](https://badge.fury.io/rb/signet.svg)](https://badge.fury.io/rb/signet)
## 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
``` ruby
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 => "#{YOUR_CLIENT_ID}.apps.googleusercontent.com",
:client_secret => YOUR_CLIENT_SECRET,
: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 is supported on Ruby 2.7+.
Google provides official support for Ruby versions that are actively supported
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
in security maintenance, and not end of life. Older versions of Ruby _may_
still work, but are unsupported and not recommended. See
https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
support schedule.