Using Oauth 2.0 with Conect SOAP

We recently upgraded our Pega version to the latest patch of 8.6.6 and it was indicated that for this version,
it would be possible to use the OAuth 2.0 authentication model for SOAP connectors as per the official documentation:

Note: Pega Platform supports OAuth 2.0 authentication for SOAP connections in the following product versions:
8.6.3 and later
8.7.1 and later

We started configuring our connector based on this premise and identified that, at the time of processing the connector call,
it triggers the Authentication profile rule to capture the token, however:

It assembles the token – Bearer [token]

Bearer eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBMV81IiwiY3R5IjoiSldUIn0.Z39UdD5V1_oRj1zdMG7aFifB_q7vC8R1d_7T90na_LX6AlPSOJ_L_gOi3OgrqZI2lzcPU751Wlh1QO3v3lbzxUlVLK-es8I7wEp-k2KUixyhVs-dwEbK2PMOe7hZ__Q7JtZestKKKZhy17RdkEw_w9bI2TJMIeacxzvL5fFWWVLu2WaqmBBDD3bxJoFKvIr8bpUWJmBmwTF1spERgJc9dOY24Ib50sVOvsbJAvfy-3J5CYnGZ5vzCOa4E4R8lV57MNmtsKBv6395cY1PFmjli67o2XPRRLQIgjho5aywm4SlE6gtW32jS5MX3gbdN9QTfwirvvOlZmvv8skhoh0Ncw.RmShNeQ_aszz3nXOUxdJ8g.kc3ayaiGKb2Y3JpSmdPnCh74Im8CZsbrGZFuBgZToc5E_9ChL0KMe0SGcL8HjJCcUSqOqJmeStZOpxr7H-9wXUy-I6zHMUsYrirab9xcFiu9b1I8Bu6iua8B1I6Mrt6NcJZdfciN1oywPK_FVc6SB8OXaMqE_ZYGQ9uCBdMopausrmWJTO7JIi8aJTjMf7jqOSXEy7-AkjWfEb7g-2Wc69GkG-EoNuyPsToAWx0OR8bigtmmil1UyE26bpBijsB_QzOK_nMCCOiZ-AHgy61SJrnVJVzgi8zMB0qw3HFW1BR_rnsDW0-YgUN5tR5hOjhBx4cB11X4tMaNqAjfPtcSoWqTcd3cpGC7NsKO90CHwi4XxI5-RPFElkF9cutT-5fqZlhKwkjZm-SPAoDppjg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3yakw-m5anJTuGCcKLRRwdgwhSWJ850dZPDU5e-nkVsIEAstye4HYEgqOnO4PYGr595Jqy9yb_JBDP0XM_KbK6qVmBsX6wxUk53Rye1dnmsmU9dHBpmjoJO08LNy7zHiQ6uhHctDtqMyrhFqIPAU3MJnQ5pzfCPYBxt0AIwAVmyRz51sVKGc0nDhZzDwhGg-HCevC2kyiaPGi4bWbLa25X4yj5nwimdfCzZE_FWMMfbg_44fEvDKyPVh2pUhcKxJGxWhfgSUFjFvhSR0qE_DzZgKea7Ugf4Y2avdrTvD.wkfai6NUzYzMefUtunI3PA

This means that it triggered our security service which is responsible for this. However, when it proceeds to process the connector call to obtain the response,
it receives the following information:

Exception - java.lang.IllegalArgumentException: Username may not be null

I need support to understand if the authentication part for using SOAP connector – utilizing OAuth 2.0 – is valid for version 8.6.6.
If there is any hotfix to correct this issue, I require guidance.

In Attachment more details

Erro_Oauth_2.0.docx (243 KB)

@GuiValino1984 Are you using any custom HTTP Headers
please note by default OOTB Rules will not support to pass the custom Headers

@Manojkumar_ J

As we are using version 8.6.6, despite the functionality being available in the documentation, there is a problem with OOTB

Unfortunately this is an OOTB issue that we identified previously.

The issue has been resolved in Pega 8.7.5 and beyond. Upgrading to the latest platform will resolve the issue.

If you are unable to upgrade right now you can resolve the issue by making the followning local modification:

  1. Open invokeAxis2 Activity

  2. Navigate to step 8 (this is a Java Step)

  3. Modify the java step by adding in line 188

  • auth = null;

We had to specialize the rule by applying the adjustment so that it can be used.