cancel
Showing results for 
Search instead for 
Did you mean: 

Destination config - OAuth2SAMLBearerAssertion with SAP JAM is not working as expected

Former Member
0 Kudos

I have created a java application as per the instructions given in https://github.com/SAP/SAPJamSampleCode/tree/master/ODataSamples/ for creating a group in JAM.

If I hit create group servlet of application launched in HCP i get the following error:

System headers cannot be generated due to : com.sap.core.connectivity.httpdestination.common.HeaderGenerationException: Cannot generate OAuth 2.0 SAML Bearer Assertion because there is no user logged in the current thread.

Could you please suggest me what is that I'm missing here ??

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

The security part in web.xml which would also trigger the login process?

Former Member
0 Kudos

I gave the resource-ref config as pasted below. But I did not give the login - config. Is that the catch here ??

<resource-ref>

  <res-ref-name>sap_jam_odata</res-ref-name>

  <res-type>com.sap.core.connectivity.api.http.HttpDestination</res-type>

</resource-ref>

I did not give the below part in my web.xml :

<login-config>

  <auth-method>FORM</auth-method>

</login-config>

Vlado
Advisor
Advisor
0 Kudos

Absolutely! And the rest of the security part too.

Former Member
0 Kudos

I have given the all the configs mentioned above and now when i hit the servlet url from my browser, I get this error . I'm using Chrome Browser

document.write("Please wait ...");</script></p><noscript><p>Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.</p></noscript><form method="post" action="https://accounts.sap.com/saml2/idp/sso/accounts.sap.com">