Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

NumberFormatException occurs when using REST Connect with OAuth

SA-85890

Summary



NumberFormatException occurs when using REST Connect with OAuth autnetication.


Error Messages



Connect-REST configured with OAuth 2.0 is throwing a NumberFormatException trying to decrypt access token.
com.pega.pegarules.pub.services.OutboundMappingException: Caught Exception while creating OAuth2 client 
at  com.pega.pegarules.integration.engine.internal.connect.rest.ComponentsOAuth20HttpAuthScheme.setCredentials(ComponentsOAuth20HttpAuthScheme.java:125) ~[printegrint.jar:?] at com.pega.pegarules.integration.engine.internal.connect.rest.ComponentsOAuth20HttpAuthScheme.configure(ComponentsOAuth20HttpAuthScheme.java:298) ~[printegrint.jar:?] at
.
.
.
at com.pega.pegarules.integration.engine.internal.util.OAuth2Utils.getDecrytedAccessToken(OAuth2Utils.java:321) ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.util.OAuth2Utils.decryptAccessToken(OAuth2Utils.java:111) ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.client.oauth2.OAuth2ClientImpl.getAccessToken(OAuth2ClientImpl.java:294) ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.client.oauth2.OAuth2ClientImpl.updateHttpRequestWithAccessToken(OAuth2ClientImpl.java:1072) ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.client.oauth2.OAuth2ClientImpl.updateHttpRequestWithAccessToken(OAuth2ClientImpl.java:1087) ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.connect.rest.ComponentsOAuth20HttpAuthScheme.fetchAccessToken(ComponentsOAuth20HttpAuthScheme.java:101) ~[printegrint.jar:?]



Steps to Reproduce



Create a REST Connect rule and test the connectivity.


Root Cause



The token size exceeded the 4000 database column size where the pr_data_token.pyaccesstoken is stored. The size of the the access token is 4001.


Resolution



Perform the following local-change:
  1. Increase the column size to 6000 in the table pr_data_token for the pyaccesstoken column.
  2. Restart the server.

Published August 15, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us