Skip to content

andrey-skat/omniauth-mail_ru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: '[email protected]',
      info: {
        gender: 'm',
        name: 'Алексей Иванов',
        locale: 'ru_RU',
        first_name: 'Алексей',
        last_name: 'Иванов',
        email: '[email protected]',
        image: 'https://....'
      },
      credentials: {
          token: '4ec9286c2f...',
          refresh_token: '351456424ad7c5...',
          expires_at: 1411054463,
          expires: true
      }
  }

About

OmniAuth OAuth2 strategy for Mail.ru

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages