cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI OAuth2 Authorization Code (Generic) The Provider 'Generic' did not return a refresh token

mark_fryu
Participant

Accepted Solutions (1)

Accepted Solutions (1)

TuncayKaraca
Active Contributor
0 Kudos

Hi @mark_fryu,

Probably it happens if you use OAuth2 a 'Refresh Token' which expires. Check out SAP KBA 3361116 - Expired Refresh Token for OAuth2 Client Authorization Code 

"Cause This error occurs when you attempt to use an OAuth2 Authorization Code Credentials artifact in Cloud Foundry, which uses a 'Refresh Token' which expires. In Cloud Foundry, it is only supported to use OAuth2 Client Authorization Code credentials whose refresh token does not expire. This is also mentioned in the SAP Help Documentation for Deploying an OAuth2 Client Authorization Code with Generic Provider - "

"There are several options available to avoid this issue from occurring - 

  1. Configure the OAuth2 Client Authorization Code Credentials artifact to use a refresh token which does not expire
  2. Continue to use a refresh token which does expire, but bear in mind that it will be necessary to perform the 'Authorize' action on the 'OAuth2 Client Authorization Code credential artifact periodically, prior to the expiry of the refresh token. It may be beneficial to increase the expire period of the refresh token in this case. However, this option will also mean that it's necessary to trigger this 'Authorize' action every time, before the refresh token expires, or the error will reoccur.
  3. Implement an authentication mechanism other than OAuth2 Client Authorization Code Credentials Grant"

Regards,
Tuncay

Answers (0)