+ Start a Discussion
Larry (Kendal) WieskopfLarry (Kendal) Wieskopf 

Refresh Token error - Connected App

Hi, I am not a developer and I need help. I have a client that is using GravityPlus Salesforce API and suddenly is getting an invalid session and expired access error. This form was previously functioning and still works when they do a test entry.

I have change the IP Relaxation to Relax IP restrictions and left Refresh Token Policy as Refresh token is valid until revoked. But the client is still getting an error.

Below the client has provided the error log:
2018-03-19 10:24:24.809132 - DEBUG --> GFP_Salesforce_OAuth2::request_access_token
2018-03-19 10:24:24.809220 - DEBUG --> Using refresh token
2018-03-19 10:24:24.809302 - DEBUG --> GFP_Salesforce_OAuth2::make_request
2018-03-19 10:24:24.809386 - DEBUG --> API URL: https://login.salesforce.com/services/oauth2/token
2018-03-19 10:24:24.809468 - DEBUG --> Parameters:Array
(
[client_id] => 3MVG9g9rbsTkKnAVKlnBCMYcCc9YsOGFcvaelLX4CS5oFYUicm0seZwlyXTdfy4gaKLSavUpUultcWNrf0VS5
[redirect_uri] => https://www.kendal.org/?callback=gravityformssalesforce
[client_secret] => 615469769594236820
[grant_type] => refresh_token
[refresh_token] => 5Aep861hJJeETRTRP.s1Gw5CwUMhk3sdiAeMgbGFqyK06wDF0EWmWBAmF4QK4iIXm59pU_fvc3lz4W46ChaC.Ts
)

2018-03-19 10:24:24.809542 - DEBUG --> Method: POST
2018-03-19 10:24:24.809632 - DEBUG --> Arguments: Array
(
[timeout] => 30
[sslverify] =>
[headers] => Array
(
)

[body] => Array
(
[client_id] => 3MVG9g9rbsTkKnAVKlnBCMYcCc9YsOGFcvaelLX4CS5oFYUicm0seZwlyXTdfy4gaKLSavUpUultcWNrf0VS5
[redirect_uri] => https://www.kendal.org/?callback=gravityformssalesforce
[client_secret] => 615469769594236820
[grant_type] => refresh_token
[refresh_token] => 5Aep861hJJeETRTRP.s1Gw5CwUMhk3sdiAeMgbGFqyK06wDF0EWmWBAmF4QK4iIXm59pU_fvc3lz4W46ChaC.Ts
)

)

2018-03-19 10:24:25.006310 - ERROR --> Error: Array
(
[error] => invalid_grant
[error_description] => expired access/refresh token
)

2018-03-19 10:24:25.006438 - DEBUG --> response did not have an access token
2018-03-19 10:24:29.812345 - DEBUG --> GFP_Salesforce_OAuth2::make_request
2018-03-19 10:24:29.812
 
sivaextsivaext
Hi Larry, 

Are you using the username and password oAuth authentication flow? if yes

If the application uses the username-password OAuth authentication flow, no refresh token is issued, as the user cannot authorize the application in this flow. If the access token expires, the application using username-password OAuth flow must re-authenticate the user.

Regards,
Siva.
Larry (Kendal) WieskopfLarry (Kendal) Wieskopf
How do I know it is setup with oAuth authentication Flow?

 
Larry (Kendal) WieskopfLarry (Kendal) Wieskopf
Hi, As li mentioned before I am not a developer and I assistance. My client

Words from their web marketing team:
The plugin author insists that this is a Salesforce issue and that the token cannot expire on the plugin’s end. I’ve copied her response below.

The refresh token expiring isn't a plugin issue, but a Salesforce issue. The plugin *can't* expire your refresh token.

So I'd work with your Salesforce rep to a) adjust your refresh token policy so your refresh tokens don't expire and b) dig into why they are expiring your refresh tokens. I wouldn't think that creating additional connected apps is the solution. Here's the best resource I've found for refresh token issues:

https://salesforce.stackexchange.com/questions/65590/what-causes-a-connected-apps-refresh-token-to-expire

Normal plugin usage wouldn't cause this, though, so the solution would likely be in looking at how your organization is using the REST API as a whole.

Again, this isn't a plugin issue as the plugin cannot expire your refresh token — only Salesforce can. The plugin is simply receiving the error message from the Salesforce API.


Help PLEASE!!!