0

I am using recently announced Salesforce Integration license user for an integration using Web Server 2.0.

As per the Web Server 2.0 flow, I need to first obtain the Authorization Code. To get the Authorization code, we need to invoke the URL of the Salesforce instance by passing some parameters like client_id, callback_url, response_type etc.

When I am hitting the URL like below:

https://Instance--sandboxName.sandbox.lightning.force.com?client_id=CLIENT_ID_VALUE&redirect_uri=REDIRECT_URI_VALUE&response_type=cod

I am getting error response like "Access Restricted for API Only Users"

I know the reason for this error is because the standard integration profile has "API Only" permission checked.

So, How can I get Authorization Code using "Salesforce Integration" license user in "web server 2.0" flow?

1 Answer 1

2

You need to make a call to the oAuth endpoint, rather than the standard login page.

The format of this URL is covered in the documentation for the OAuth 2.0 Web Server Flow for Web App Integration but takes the form of:

https://MyDomainName.my.salesforce.com/services/oauth2/authorize?
client_id=CLIENT_ID&
redirect_uri=REDIRECT_URI&
response_type=code

You should just need to add the missing /services/oauth2/authorize to your URL for this to work.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .