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

https://github.com/distroid/okauth-gem

OkAuth gem
https://github.com/distroid/okauth-gem

Last synced: about 1 year ago
JSON representation

OkAuth gem

Awesome Lists containing this project

README

          

OkAuth
======

Auth class for www.odnoklassniki.ru

How to use


  1. First create aplication on odnoklassniki.ru

  2. Create action login by odnoklassniki.ru

    def loginByOk
    @options = {
    'client_id' => [your_app client_id],
    'scope' => "VALUABLE ACCESS",
    'redirect_uri' => [callback_action],
    'client_secret' => [your_app_client_secret],
    }
    redirect_to Oauth::Ok::OkAuth.new(@options).getAuthUrl
    end


  3. Create callback action

    def loginByOkCallback
    get = request.GET
    @options = {
    'client_id' => [your_app_client_id],
    'scope' => "VALUABLE ACCESS",
    'redirect_uri' => [callback_action],
    'client_secret' => [your_app_client_secret],
    'application_key' => [your_app_client_public],
    }
    userOkData = Oauth::Ok::OkAuth.new(@options).getUserData(get["code"])
    end


  4. Save userdata in DB and login him