Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

OmniAuth strategy for Rdio OAuth 1

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 omniauth-rdio.gemspec
README.md

OmniAuth Rdio

Rdio OAuth 1.0a Strategy for OmniAuth 1.0.

Installation

Add to your project Gemfile:

gem 'omniauth-rdio'

Usage

Read the OmniAuth 1.0 documentation for detailed instructions.

Pass your Rdio Application Key and Secret as arguments when initializing the provider.

For example, if using as middleware in a Rails app, add the following to an initializer:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :rdio, ENV['RDIO_APP_KEY'], ENV['RDIO_APP_SECRET']
end

Authentication Hash

Example of the provider's Auth Hash Schema (request.env['omniauth.auth']):

{
  "provider" => "rdio",
  "uid" => "aaa...",
  "info" => {
    "name" => "Gopal Patel",
    "nickname" => "nixme",
    "first_name" => "Gopal",
    "last_name" => "Patel",
    "image" => "http://cdn3.rd.io/user/no-user-image-square.jpg",
    "urls" => {
      "User" => "http://www.rdio.com/people/nixme/",
      "Collection" => "http://www.rdio.com/people/nixme/collection/",
      "Playlists" => "http://www.rdio.com/people/nixme/playlists/",
      "Following" => "http://www.rdio.com/people/nixme/people/following/",
      "Followers" => "http://www.rdio.com/people/nixme/people/followers/"
    }
  },
  "credentials" => {
    "token" => "123456...",                   # OAuth access token
    "secret" => "abcde..."                    # OAuth secret
  },
  "extra" => {
    "access_token" => <OAuth::AccessToken>,   # OAuth::AccessToken instance for making API requests.
    "raw_info" => {                           # Result of the currentUser Rdio Web Service call.
      "followingUrl" => "/people/nixme/people/following/",    # Includes all optional User fields
      "baseIcon" => "user/no-user-image-square.jpg",          #   except lastSongPlayed and
      "isTrial" => false,                                     #   lastSongPlayTime.
      "artistCount" => 64,
      "heavyRotationKey" => "eee...",
      "networkHeavyRotationKey" => "bbb...",
      "albumCount" => 114,
      "libraryVersion" => 406,
      "trackCount" => 1391,
      "type" => "s",
      "username" => "nixme",
      "collectionUrl" => "/people/nixme/collection/",
      "playlistsUrl" => "/people/nixme/playlists/",
      "key" => "aaa...",
      "collectionKey" => "ccc...",
      "followersUrl" => "/people/nixme/people/followers/",
      "icon" => "http://cdn3.rd.io/user/no-user-image-square.jpg",
      "displayName" => "Gopal Patel",
      "isUnlimited" => true,
      "firstName" => "Gopal",
      "url" => "/people/nixme/",
      "gender" => "m",
      "lastName" => "Patel",
      "isSubscriber" => true
    }
  }
}

Contributing

Patches and bug reports are welcome. Just send a pull request or file an issue. Project changelog.

Something went wrong with that request. Please try again.