+ Start a Discussion
Sonal4JSonal4J 

Unable to fetch authorization code from Summer 15 Org

  1. Created a connected app on the hub org
  2. In the connected app Enabled OAuth Settings
  3. Provided full access and Perform requests on your behalf at any time (refresh_token, offline_access) oauth scope.
  4. provided a callback URL to a vf page
  5. Performed authoratization to get the summer 15 org authorization code.
  6. Pop up came to enter the target org's username and password.
  7. once entered , The connected app requested permission.
  8. Click allow. Instead of redirecting to the source org it tried to access the the redirect page on the target org.
  9. This issue appears when the target org is on summer 15. It worked fine with spring 15
  10. If source and target are on Summer 15 it does not work. While when source and target are on spring 15 it works
SonamSonam (Salesforce Developers) 
I've gone through the case you have raised and understand that this issue doesn't come up when you are using the instance in the Callback instead of login.salesforce.com:
When making callback, remember to use the instance such that Salesforce knows which session to redirect the page to.
Sonal4JSonal4J

Hi Sonam,

I had figured out that the issue appears in Summer 15  when I use generic callback url . For eg - https://login.salesforce.com/apex/vfpage_name. It works fine when I use instance name. For eg:- https://na24.visual.force.com/apex/vfpage_name.

But using a generic URL worked till spring 15. Is this something that salesforce has stopped supporting from summer 15? or is this a bug at salesforce end?

When I used to use generic URL with spring 15 I had to login twice. 1st time on my target org and 2nd time back on my source org.
SonamSonam (Salesforce Developers) 
I checked with the dev team and they confirmed its always been this way..not sure how/why it was working with the generic URL - I suppose this was the reason why it asked you to login to the ORGs so as to understand where the page existed.
Sonal4JSonal4J
Hi Sonam, This means it was not itended to work with generic URL, though the previous versions were supporting this. A last query as you previously said that "When making callback, remember to use the instance such that Salesforce knows which session to redirect the page to. " How does it works my source and target orgs are on the same instance? How Salesforce knows in this case which session to redirect the page to? Thanks, Sonal