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

Development

>= 12.0
>= 3.6
~> 0.49

Runtime

 Project Readme

OmniAuth Mail.ru

This is unofficial OmniAuth OAuth2 strategy for Mail.ru.

Using

Add this gem to your Gemfile:

gem 'omniauth-mail_ru'

Configuration

Next, tell OmniAuth about this provider. For a Rails app, your config/initializers/omniauth.rb file should look like this:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :mail_ru, 'API_KEY', 'PRIVATE_KEY'
end

Replace "API_KEY" and "PRIVATE_KEY" with the appropriate values you obtained (https://oauth.mail.ru/app).

Authentication Hash

An example auth hash available in request.env['omniauth.auth']:

{
      provider: 'mail_ru',
      uid: 'alex@ivanov.ru',
      info: {
        gender: 'm',
        name: 'Алексей Иванов',
        locale: 'ru_RU',
        first_name: 'Алексей',
        last_name: 'Иванов',
        email: 'alex@ivanov.ru',
        image: 'https://....'
      },
      credentials: {
          token: '4ec9286c2f...',
          refresh_token: '351456424ad7c5...',
          expires_at: 1411054463,
          expires: true
      }
  }