0
votes

Now, I have created a connected app, selected some oauth scopes, set a callbackUrl(https://login.salesforce.com/services/oauth2/success).

Then add it to the package, bulid a release package. When install the package in the Professional/Group Edition, I invoke the rest API, obviously, it failed , then the authorize starts work

(The url is https :// ap2.salesforce.com /services /oauth2 /authorize?response_type = code&scope = full + refresh_token & client_id = {0}&redirect_uri = https :// login.salesforce.com /services/oauth2/success).

But it looks not work, and dispaly a message

'Remote Access Application Authorization'.

In Expection, I want this.

click allow authorize, deny not.

1

1 Answers

0
votes

Youtube: Salesforce Rest API using oAuth 2.0

STEP 1: Create OAuth APP on Salesforce developer portal [ Will create video for this too ]

STEP2: Make the following things handy CONSUMER KEY CONSUMER SECRET Hit following url with CONSUMER_KEY as clientId

https://login.salesforce.com/services... CONSUMER_KEY&redirect_uri=http://tagbin.in/

in response it will return code in the callback URI, keep that handy too

STEP 3: Now we need to exchange this code for access token, hit the following URI, POST request

https://login.salesforce.com/services...

POST PARAMS (URL ENCODED PARAMS) : code=CODE_FROM_STEP_2&grant_type=authorization_code&client_id=CONSUMER_KEY&client_secret=CONSUMER_SECRET&redirect_uri=https%3A%2F%2Ftagbin.in%2F

this will return a json, make handy 2 of the JSON key: -access_token -instance_url

Now you can use this access_token to hit all endpoint on salesforce