AEM+Hybris integration - OAuthHandler - authentication failed | Community
Skip to main content
Pk_SB
New Participant
February 22, 2016
Solved

AEM+Hybris integration - OAuthHandler - authentication failed

  • February 22, 2016
  • 7 replies
  • 2584 views

Hi Friends,
I have tried the AEM + Hybris integration(out of box), I have followed all the steps from docs.adobe.com. when I am trying to import catalog from hybris, I am getting the following error in AEM error logs,
22.02.2016 16:07:40.017 *INFO* [0:0:0:0:0:0:0:1 [1456137459912] POST /libs/commerce/products HTTP/1.1] com.adobe.granite.repository Service [3438, [java.lang.Runnable]] ServiceEvent REGISTERED
22.02.2016 16:07:40.044 *INFO* [0:0:0:0:0:0:0:1 [1456137459912] POST /libs/commerce/products HTTP/1.1] com.adobe.cq.commerce.hybris.importer.DefaultHybrisImporter A /etc/commerce/products/outdoors/outdoors/en
22.02.2016 16:07:40.056 *ERROR* [0:0:0:0:0:0:0:1 [1456137459912] POST /libs/commerce/products HTTP/1.1] com.adobe.cq.commerce.hybris.impl. Server did not respond with 2xx -> authentication failed.
22.02.2016 16:07:40.072 *ERROR* [0:0:0:0:0:0:0:1 [1456137459912] POST /libs/commerce/products HTTP/1.1] com.adobe.cq.commerce.hybris.impl.OAuthHandler Server responded with 400 -> authentication failed.
22.02.2016 16:07:40.075 *ERROR* [0:0:0:0:0:0:0:1 [1456137459912] POST /libs/commerce/products HTTP/1.1] com.adobe.cq.commerce.hybris.importer.DefaultHybrisImporter Importing catalog "outdoors" from Hybris failed: 
java.lang.NullPointerException: null
at com.adobe.cq.commerce.hybris.impl.OAuthHandler.authenticateSession(OAuthHandler.java:208)
at com.adobe.cq.commerce.hybris.impl.OAuthHandler.executeAuthenticated(OAuthHandler.java:457)
at com.adobe.cq.commerce.hybris.common.DefaultHybrisConnection.execute(DefaultHybrisConnection.java:167)
at com.adobe.cq.commerce.hybris.importer.DefaultHybrisImporter.importProducts(DefaultHybrisImporter.java:403)
at com.adobe.cq.commerce.hybris.importer.DefaultHybrisImporter.importCatalog(DefaultHybrisImporter.java:197)
at com.adobe.cq.commerce.hybris.importer.DefaultHybrisImporter.doImport(DefaultHybrisImporter.java:236)
at com.adobe.cq.commerce.pim.common.AbstractImporter.run(AbstractImporter.java:167)
Please help..

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jitendra_S_Toma

Well,

The Hybris server may be up and this AEM request is not allowed by your server. The Server treats this request as bad request. Does the server have any firewall in place which prevents AEM request to complete?

You could check server admin also.

---

Jitendra

7 replies

New Participant
May 18, 2017

The issue is due to hybris not exposing the token on correct url ,generally in older version of hybris the token is exposed on below url 

https://localhost:9002/rest/oauth/token

But in newer implementation they have changed the url to below

https://localhost:9002/authorizationserver/oauth/token

One option is to create a redirect filter in hybris which redirect /rest/oauth/token to /authorizationserver/oauth/token

New Participant
November 22, 2016

Hi, Please install hybris OCC version i was facing the same issue but after installing hybris 5.7 OCC version oath handler works because OCC version has OATH handler in it.

To make hybris OCC version just add ycommercewebservice extension and build ur system again.

Hope this helps

Jitendra_S_Toma
New Participant
February 22, 2016

hmmm. That's interesting.

----Jitendra

Pk_SB
Pk_SBAuthor
New Participant
February 22, 2016

Thanks for your reply Jitendra.. Both AEM server and Hybris server are running in the same machine..  I hope there is no chance of firewall coming into picture..

Jitendra_S_Toma
Jitendra_S_TomaAccepted solution
New Participant
February 22, 2016

Well,

The Hybris server may be up and this AEM request is not allowed by your server. The Server treats this request as bad request. Does the server have any firewall in place which prevents AEM request to complete?

You could check server admin also.

---

Jitendra

Pk_SB
Pk_SBAuthor
New Participant
February 22, 2016

Hybris server is running..I am able to access the hybris server.. Passowrd also correctly given..

Jitendra_S_Toma
New Participant
February 22, 2016

Based on logs information. I would suggest to verify following things:

  • Hybris server is running or not. THIS SEEMS THE ROOT CAUSE
  • Hybris connector configuration is done rightly on AEM. Specially check password again.

----

jitendra