This discussion is archived
3 Replies Latest reply: Nov 4, 2013 11:13 PM by Habib RSS

Acquiring an Access Token via coding (in Salesforce) - not web logon screen

ittichai Journeyer
Currently Being Moderated

I'm setting up APEX REST security by following the instructions from  Everything works great according to document. I can acquire a token, then passing it in the header to get needed data from REST service.


Consumer acquires an token by going on web browser to https://server:port/apex/resteasy/oauth2/auth?response_type=token&client_id=CLIENT_IDENTIFIER&state=STATE   It will be redirected to https://servert:port/apex/restwasy/sign-on?r=oa  asking for username and password on browser. Once entering them correctly, it will be directed to Redirect URI defined in the OAuth2 client with the token in the URL.


My question is that is it possible to do token acquiring by coding (like in Salesforce) without going to web browser? We've tried doing that, it will stop due to redirect to sign-on.


Thanks in advance.




  • Correct Answers - 10 points
  • Helpful Answers - 5 points