The project is in a healthy, maintained state
TinkoffId OAuth2 Strategy for OmniAuth
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.5, <= 1.8.0
 Project Readme

T-Id OAuth strategy for OmniAuth

Ruby

sponsored by foxford

Getting Started

Prerequisites

This gem require OmniAuth

But you no need add gem 'omniauth'.

This gem already added.

Installation

gem "omniauth-tinkoff-id"

Join to TinkoffId

Usage

  1. Add to omniauth.rb tinkoff_id provider:

     Rails.application.config.middleware.use OmniAuth::Builder do
         provider :tinkoff_id, ENV['TINKOFF_CLIENT_ID'], ENV['TINKOFF_CLIENT_SECRET']
     end
    
  2. Add route

     get '/auth/:provider/callback', to: 'sessions#create'
    
  3. Create SessionController

note: This controller only as example how to create user by callback
    class SessionsController < ApplicationController
      def create
        @user = User.find_or_create_from_auth_hash(auth_hash)
        redirect_to '/'
      end

      protected

      def auth_hash
        request.env['omniauth.auth']
      end
    end

Contributing

  1. Fork it (https://github.com/foxford/omniauth-tinkoff-id/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License.

Acknowledgments