cancel
Showing results for 
Search instead for 
Did you mean: 

Salesforce API skills; Error in "GetTokenActive" in authenticate credential process

NavithaK
Level 3
Hi,

When I am running "GetTokenActive" step in authenticate page, I am getting the below error.
6408.png

------------------------------
Navitha K
------------------------------
15 REPLIES 15

ewilson
Staff
Staff
Hi Navitha,

Can you confirm that you're running the test process available from the DX? If so, can you also confirm that the Authenticate stage​, just before the GetTokenActive stage returned a successful response? In other words you received an access token and instance URL value?

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

Hi Wilson,

Thank you for the response.

I am running the test process which is available from the DX. 
In the Authenticate stage, I am getting http status code as 200 and also instance URL value. But when I am running GetTokenActive stage, it is getting failed.

------------------------------
Navitha K
------------------------------

Ok, so according to what I've seen on various Salesforce.com forums the 401 error with "invalid_client" indicates that SFDC believes the Client ID and/or Client Secret you're passing in is invalid. I would verify that what was copied into the Salesforce Grant credential in Credential Manager, for the Consumer Key and Consumer Secret properties, are correct values. Make sure there's no additional white space at the beginning or end of the values.
 
An additional step you can take to verify those values is to go into System -> Objects -> Web API Services and open the Salesforce Authentication service definition. Click on the Salesforce Token Introspection action and check the flags next to Enable Request Data Output Parameter and Disable Sending of Request. After that, go back to your test process (make sure to click the reload button if it was already open so it picks up the changes in the Web API) and double-click on the GetTokenActive stage. Go to the Outputs tab and create a new data item for the Request Data output. Then run the process and see what the request includes in the body. It should look something like this:

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

Compare the values of Consumer Key and Consumer Secret with your credential from SFDC.

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

After checking those flags in Salesforce Token Introspection and running the test process, it is giving the below error in GetTokenActive stage.

6328.png

------------------------------
Navitha K
------------------------------

Hmm, that's interesting, but I verified I get the same error on my side. That's the first time I've seen BP throw a fit when setting those values. My only guess is that it's still trying to execute the custom code tied to processing the Response - which it shouldn't.

Anyway, back to the issue at hand. One thing I noticed in my copy of the test process is that no value was set for the input Login URL on the GetTokenActive stage. Can you confirm that you've set the value for that to [Instance URL] ?

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

No value has been set for the input Login URL

------------------------------
Navitha K
------------------------------

Ok. Rollback the two changes you made in the Web API service definition, and then set the value of the Login URL item on the GetTokenActive stage to [Instance URL] and see how that works.

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

After setting the value of the login URL item in GetTokenStage to [Instance URL] also, it is showing as invalid credentials.

I also tried with the login value to https://login.salesforce.com but still it is showing the error.

------------------------------
Navitha K
------------------------------

In the Expiry data item, I am getting the value as 1/1/1970 12.00.01 AM. It is not showing the current date.

------------------------------
Navitha K
------------------------------