cancel
Showing results for 
Search instead for 
Did you mean: 

Bp V6.6 : Web API + oAuth + Salesforce

ManishaP
Level 3

Hello,

I am unable to retrive access token with salesforce oauth provider. I am able to do it in postman with same details. Below is my configuration:

28431.png

28432.png
28433.png
28434.png
28436.png



------------------------------
Manisha P
------------------------------
1 BEST ANSWER

Best Answers

ewilson
Staff
Staff
Hi @Manisha P,

Your problem is related to how you've defined the URL in your Web API. Web API's are made up of a base URL and then the path that's specific to each action. You need to define the base URL portion at the top level of the Web API similar to what's shown below:

28356.png
Once you have your base URL portion defined, you can add the action path. In this case you'd have something like this:

28357.png
When the request is actually invoked, Blue Prism will concatenate the base URL and the action path together.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

View answer in original post

7 REPLIES 7

ewilson
Staff
Staff
Hi @Manisha P,

Your problem is related to how you've defined the URL in your Web API. Web API's are made up of a base URL and then the path that's specific to each action. You need to define the base URL portion at the top level of the Web API similar to what's shown below:

28356.png
Once you have your base URL portion defined, you can add the action path. In this case you'd have something like this:

28357.png
When the request is actually invoked, Blue Prism will concatenate the base URL and the action path together.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @Eric Wilson

Thank you very much for your immediate help and response . It worked But now I am getting a Status 400. ​​
28363.png

My grant types is "password" . Can you please help me with what i am missing. 

Thanks in advance. 



------------------------------
Manisha P
------------------------------

Hi @ewilson

I got the above 400 error resolved. my authentication type was wrong once I changed it to oAuth2 it resolved that error. ​now it is saying the below. I have whitelisted the serverIP in salesforce and still seeing this error. 

what might be the issue ?

28371.pngThanks in advance. 



------------------------------
Manisha P
------------------------------

Hi @Manisha P,

I believe this is tied to the permissions on the credential, in Credential Manager, you've associated with the WebAPI​. Take a look at the credential definition and you should see some tabs that allow you to specify which processes and resources can access that credential. Make sure you process is enabled for the credential as well as you runtime resource.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thank you @ewilson !!

That worked I gave access rights to all users/process/resources. Now again ​i am getting Invalid grant type error:

28391.png

28392.png

Could you please tell me what else i might be missing. Thank you for your patience.



------------------------------
Manisha P
------------------------------

@Manisha P,

My understanding of the SFDC authentication and authorization process is that it's basically a two step process. Your first call to SFDC should include values for:
  • Grant Type
  • Consumer Key
  • Consumer Secret
  • Username
  • Password
If this call is successful, you'll receive an access token and ​instance URL from SFDC. After that, you must issue another request to SFDC that includes the following input values:
  • The access token you just received
  • Consumer Key
  • Consumer Secret
  • token_type_hint = access_token
These values are sent (HTTP POST) to the URL path /services/oauth2/introspect. The body of the request looks like this:

token=[Access Token]&client_id=[Consumer Key]&client_secret=[Consumer Secret]&token_type_hint=[token_type_hint]

Make sure to add a Content-Type header to the request with the value set to application/x-www-form-urlencoded. From that, you'll receive a JSON response that includes validation information such as active and exp (expiration date in Unix time).

Make sure that all follow-up requests to SFDC use the instance URL you received as the URL of the request.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thank you @ewilson. I will try that out​

------------------------------
Manisha P
------------------------------