Skip to content

Commit

Permalink
urls and methods modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Swati24 committed Mar 24, 2015
1 parent fd4803a commit 5ed2e46
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/omniauth/strategies/clever.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ class Clever < OmniAuth::Strategies::OAuth2

option :client_options, {
:site => 'https://api.clever.com',
:authorize_url => 'https://account.clever.com/oauth/authorize',
:token_url => 'https://api.clever.com/oauth/token'
:authorize_url => 'https://clever.com/oauth/authorize',
:token_url => 'https://clever.com/oauth/tokens'
}

def authorize_params
super.tap do |params|
params[:scope] = 'read_only'
params[:clever_landing] = options.client_options.clever_landing || 'admin'
if options.client_options.dev
params[:dev] = options.client_options.dev
end
params[:clever_landing] = options.client_options.fetch(:clever_landing, 'admin')
end
end

def token_params
username_password = options.client_secret + ":"
super.tap do |params|
params[:headers] = {'Authorization' => "Basic #{Base64.encode64(username_password)}"}
params[:headers] = {'Authorization' => "Basic #{Base64.strict_encode64("#{options.client_id}:#{options.client_secret}")}"}
end
end

Expand All @@ -48,4 +44,4 @@ def raw_info
end
end
end
end
end

0 comments on commit 5ed2e46

Please sign in to comment.