Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add additional fields to Salesforce strategy. #444

Merged
merged 1 commit into from

2 participants

@sailavu

Salesforce provides additional fields namely issued_at & signature that can be returned.

access_token which is returned after authorization is always perishable. But in line https://github.com/intridea/omniauth/blob/master/oa-oauth/lib/omniauth/strategies/oauth2.rb#L87

... if @access_token.expires?

always returns false causing refresh_token never to be set for Salesforce strategy.

To summarise issued_at & signature definitely needs to be added.

There may be perhaps a better way to indicate fetching of refresh_token rather the brute force approach taken in the pull request.

@sailavu sailavu Salesforce provides additional fields namely issued_at & signature th…
…at are to be returned. access_token post authorization is always perishable. Hence the need to obtain refresh_token.
4e4c361
@sferik sferik merged commit b8041a8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 27, 2011
  1. @sailavu

    Salesforce provides additional fields namely issued_at & signature th…

    sailavu authored
    …at are to be returned. access_token post authorization is always perishable. Hence the need to obtain refresh_token.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  oa-oauth/lib/omniauth/strategies/oauth2/salesforce.rb
View
3  oa-oauth/lib/omniauth/strategies/oauth2/salesforce.rb
@@ -18,7 +18,10 @@ def auth_hash
super, {
'uid' => @access_token['id'],
'credentials' => {
+ 'issued_at' => @access_token['issued_at'],
+ 'refresh_token' => @access_token.refresh_token,
'instance_url' => @access_token['instance_url'],
+ 'signature' => @access_token['signature'],
},
'extra' => {
'user_hash' => data,
Something went wrong with that request. Please try again.