An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

omniauth-typetalk
===

[![Build Status](https://travis-ci.org/is2ei/omniauth-typetalk.svg?branch=master)][travis]
[![Gem Version](https://img.shields.io/gem/v/omniauth-typetalk.svg)][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
```