cancel
Showing results for 
Search instead for 
Did you mean: 

Swagger not working with oauth2 Commerce 2005

Hi,

We are having a weird issue. Swagger is working for all the calls for which authentication is not required. But while trying to authroize the requests, we are getting this error. In the debugger console, we could see error ERR_NAME_NOT RESOLVED(https://%7Boauth2_url%7D/authorizationserver/oauth/token). As you see, swagger is not able to recognize the property {oauth2_url} .

In the custom webservices extension, we have this property defined. It was created as part of extension and we didnt add this manually.

samplewebservices.oauth2.tokenUrl=https://{oauth2_url}/authorizationserver/oauth/token

Please let me know if anybody else is facing this issue

0 Kudos

Hi, have you managed to solve this error? I face the same now.

We just replaced with the end point and it worked

In the samplewebservices.oauth2.tokenUrl=https://localhost:9002/authorizationserver/oauth/token

0 Kudos

Hello priyankamanikkoth, Thanks for providing the solution. The oauth2 authentications works with your solution.

But I am getting below error when I am trying to access any API from Swagger

{"errors":[{"type":"InvalidTokenError","message":"Invalid access token: bZsBQnRtoz3yv7xmLFGSPMDcH2U"}]}


Error from Kibana:
{"thread":"hybrisHTTP33","level":"INFO","loggerName":"de.hybris.platform.webservicescommons.oauth2.token.provider.HybrisOAuthTokenStore","message":"Failed to find access token for token 0lIbE-sNwCn1bnLCx8lvoGs8bbY","endOfBatch":false,"loggerFqcn":"de.hybris.platform.util.logging.HybrisLogger","instant":{"epochSecond":1611594208,"nanoOfSecond":824537000},"contextMap":{"RemoteAddr":"[72.181.9.63] ","Tenant":""},"threadId":175,"threadPriority":5,"origin":"PLATFORM"}

Did you face this when you tried?

Accepted Solutions (0)

Answers (0)