https://github.com/is2ei/omniauth-typetalk
Typetalk OAuth2 Strategy for OmniAuth
https://github.com/is2ei/omniauth-typetalk
typetalk
Last synced: over 1 year ago
JSON representation
Typetalk OAuth2 Strategy for OmniAuth
- Host: GitHub
- URL: https://github.com/is2ei/omniauth-typetalk
- Owner: is2ei
- License: mit
- Created: 2018-12-24T15:28:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T12:25:04.000Z (over 7 years ago)
- Last Synced: 2025-02-13T16:04:43.889Z (over 1 year ago)
- Topics: typetalk
- Language: Ruby
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
omniauth-typetalk
===
[][travis]
[][rubygems]
[travis]: https://travis-ci.org/is2ei/omniauth-typetalk
[rubygems]: https://rubygems.org/gems/omniauth-typetalk
Typetalk OAuth2 Strategy for OmniAuth
## Basic Usage
```ruby
use OmniAuth::Builder do
provider :typetalk, ENV['TYPETALK_KEY'], ENV['TYPETALK_SECRET']
end
```
## Sinatra Example
```ruby
require 'sinatra'
require 'omniauth'
require 'omniauth-typetalk'
use Rack::Session::Cookie
use OmniAuth::Builder do
provider :typetalk, ENV['TYPETALK_KEY'], ENV['TYPETALK_SECRET'], scope: "my topic.read"
end
get '/' do
<<-HTML
Sign in with Typetalk
HTML
end
get '/auth/:name/callback' do
auth = request.env['omniauth.auth']
<<-HTML
[Profile]
id: #{auth.info.id}
name: #{auth.info.name}
fullName: #{auth.info.fullName}
suggestion: #{auth.info.suggestion}
imageUrl: #{auth.info.imageUrl}
createdAt: #{auth.info.createdAt}
HTML
end
```