Closed d00001 closed 10 years ago
I need it to work with partner portal users. I tried following what I think is your article: https://developer.salesforce.com/blogs/developer-relations/2013/02/oauth-for-portal-users.html
For some reason the url in the form
https://mysite.secure.force.com/services/oauth2/authorize?response_type=code&client_id=<your_client_id>&redirect_uri=<your_redirect_uri>
redirects to
login.salesforce.com/...
and partner portals users cannot authenticate. Only regular users. Do you have an idea why?
My code works fine for regular users.
That URL syntax should work. Could you email me the URL you're using so I can check it and see what the redirects look like? [email address removed]
I found the problem I was calling the url with
?prompt=login&display=touch
I removed these and it worked.
Thanks
Great! Not sure why one or both of those parameters would cause it to break. I passed this on to the identity team at SFDC. Not an issue in the toolkit!
Is the Username and Password flow supported for Partner portal users?
Not sure, and I don't have a partner portal handy to try it out - I'll ask the identity team. Fastest thing would be to try it yourself and see.
One thing that should work is SOAP login. You can specify the org id and portal id in the LoginScopeHeader, then use the resulting session id with the REST API. You'll just need to build and parse the XML.
I tried but I get
authentication failure - Unknown exception: 1201
when trying portal users but it works fine for regular users.
I'm working on a phonegap app so I need it to work with javascript. I looked into the AJAX toolkit, does it work with external websites?
You'll have the same login issues with the AJAX toolkit - the problem is getting the token for a user.
You seemed to have the User Agent flow working. You should use this from a PhoneGap app, rather than username/password.
Yes, it should do, as long as the user's profile is API enabled. Please let me know if it works for you, so I can close the issue, or help diagnose any problems.