0.04
No release in over 3 years
Low commit activity in last 3 years
OmniAuth strategy for Yandex.ru
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Yandex OAuth strategy for OmniAuth

travis Maintainability Reviewed by Hound

This gem contains the unofficial Yandex OAuth2 strategy for OmniAuth.

Sponsored by Evrone

Getting Started

Prerequisites

This gem require OmniAuth

But you no need add gem 'omniauth'.

This gem already added.

Installation

gem "omniauth-yandex"

Register new app for sync on yandex:

  1. Obtain API key for your app at Yandex OAuth app registration page
  2. Enter callback url for auth

  1. Select service and its data for auth

Usage

  1. Add to omniauth.rb yandex provider:

     Rails.application.config.middleware.use OmniAuth::Builder do
         provider :yandex, ENV['YANDEX_ID'], ENV['YANDEX_PASSWORD']
     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
  1. Run rails server and open page

    localhost:3000/auth/yandex

  2. Sign In yandex by own username and password

  3. Take app permissions:

Contributing

Please read Code of Conduct and Contributing Guidelines for submitting pull requests to us.

Versioning

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

Changelog

The changelog is here.

Authors

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

License

This project is licensed under the MIT License.

Acknowledgments