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

OutboundMappingException: Caught Exception while creating OAuth2

SA-79162

Summary



Error occurs when using OAuth2.0 security on the Pega application with Connect-REST.


Error Messages



[tp-apr-8080-exec-116] [STANDARD] [ ] [AppStack:01.01.01] (internal.mgmt.Executable) ERROR testing-stg3.pegacloud.net|Rule-Connect-REST.AppStack-Int-Package.Version.Method - Exception  com.pega.pegarules.pub.services.OutboundMappingException: Caught Exception while creating OAuth2 client at com.pega.pegarules.integration.engine.internal.connect.rest.ComponentsOAuth20HttpAuthScheme.fetchAccessToken(ComponentsOAuth20HttpAuthScheme.java:112) ~[printegrint.jar:?]  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:?]  
<SNIP> 
Caused by: java.lang.NumberFormatException: For input string: "1+"  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_171]  at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_171]  at com.pega.pegarules.pub.util.StringUtils.fromHexString(StringUtils.java:3251) ~[prpublic.jar:?]  at com.pega.pegarules.integration.engine.internal.util.OAuth2CryptoUtils.decrypt(OAuth2CryptoUtils.java:79) ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.util.OAuth2CryptoUtils.decryptAccessToken(OAuth2CryptoUtils.java:170) ~[printegrint.jar:?]  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)~



Steps to Reproduce



Invoke a service that uses OAuth.


Root Cause



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


Resolution



As a local-change, increase the column size to greater than 4000 to accommodate tokens.

Published May 7, 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