We are passing the token URL, clientID and client Secret, even in logs we are able to see still we are getting "HTTP/1.1 400 Bad Request, code = 303003, detail = Could not generate access token for oauth configured http endpoint null org.apache.synapse.endpoints.auth.AuthException: Error while accessing the Token URL."
Could you please help me to understand this log why we are getting endpoint as null even after passing the values properly.
please find the log below.
[2023-11-29 14:17:23,504] INFO {org.apache.synapse.mediators.builtin.LogMediator} - sourceEndpointURL = https://www.123enterpriseb2b.com/u/box/1.0/post, sourceTokenURL = https://logmein.microsoftonlineto.com/161/oauth2/1.0/token, SClient_ID = cccc9be-b9e6-6d8dd14a7f0d, SClient_Secret = xxxxC2uWceRlIrVrU2IYQdw7EaYO, SScope = default [2023-11-29 14:17:23,505] INFO {org.apache.synapse.mediators.builtin.LogMediator} - destEPSecScheme = OAUTH2 [2023-11-29 14:17:23,507] INFO {org.apache.synapse.mediators.builtin.LogMediator} - oAuth2 * isDestinationEPAvailable = 1 [2023-11-29 14:17:23,508] INFO {org.apache.synapse.mediators.builtin.LogMediator} - oAuth2 * destEndpointURL = https://www.test2.co.in/1.0/switch, destConnectionTimedOut = 5, destTokenURL = https://www.test2.co.in/oauth/accesstoken, DClient_ID = xx4vvvIoxxxxxxxxxxx, DClient_Secret = mkmkkkgLVnBcmmm, DScope = default [2023-11-29 14:17:23,508] INFO {org.apache.synapse.mediators.builtin.LogMediator} - I am = StateTransitionSequence [2023-11-29 14:17:23,509] INFO {org.apache.synapse.mediators.builtin.LogMediator} - I am = messageInstancesSequence [2023-11-29 14:17:23,509] INFO {org.apache.synapse.mediators.builtin.LogMediator} - I am = Get currentRetry [2023-11-29 14:17:23,517] INFO {org.apache.synapse.mediators.builtin.LogMediator} - MI.ID = 405729 [2023-11-29 14:17:23,518] INFO {org.apache.synapse.mediators.builtin.LogMediator} - currentRetryNumber + 1 = 1 [2023-11-29 14:17:23,530] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Info2 = currentRetry updated* [2023-11-29 14:17:23,539] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Info1 = MessageStateTransitions Entry added* [2023-11-29 14:17:23,539] INFO {org.apache.synapse.mediators.builtin.LogMediator} - I am = messageInstancesSequence [2023-11-29 14:17:23,540] INFO {org.apache.synapse.mediators.builtin.LogMediator} - I am = Update cusrrentState into MessageInstances, currentState = Dispatched, routingID = residentialSwitchMatchRequest, s_identity = RRRR [2023-11-29 14:17:23,541] INFO {org.apache.synapse.mediators.builtin.LogMediator} - isRetry = 1 [2023-11-29 14:17:23,541] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:746961cf-b9c0-4ce8-942b-f0af1954d32d, correlation_id: 61a83143-685b-47b1-a7e6-1e3cb1864167_e13f2391-71cd-464b-bbe5-1e0ff7e78522, Direction: request, Payload: {"xxxxxxxxxxxx": "xxxx"} [2023-11-29 14:17:23,548] INFO {org.apache.synapse.mediators.builtin.LogMediator} - UpdateMessageInstance MI.ID = 405729 [2023-11-29 14:17:23,558] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Info2 = Message Entry updated* [2023-11-29 14:17:23,619] INFO {org.apache.synapse.mediators.builtin.LogMediator} - StatusCode from Endpoint = 400
[2023-11-29 14:17:23,619] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Message = 40X Exception from Destination!!!, statusCode = 400 [2023-11-29 14:17:23,619] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Info = I am 400 so 9006 Unable to deliver the message to the destination, rejected, invalid message format [2023-11-29 14:17:23,619] INFO {org.apache.synapse.mediators.builtin.LogMediator} - I am = Failure Post Office Message Preparing Sequence, failureID = 9006, sourceEPSecScheme = OAUTH2, sourceEPRowCount = 1, isSourceEPAvailable = true [2023-11-29 14:17:23,619] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Message = Preparing the 9006 post office message, destHttpCode = 400 [2023-11-29 14:17:23,688] ERROR {org.apache.synapse.endpoints.OAuthConfiguredHTTPEndpoint} - Could not generate access token for oauth configured http endpoint null org.apache.synapse.endpoints.auth.AuthException: Error while accessing the Token URL. HTTP/1.1 400 Bad Request [2023-11-29 14:17:23,688] INFO {org.apache.synapse.mediators.builtin.LogMediator} - text = An unexpected error occured onError executed, message = Could not generate access token for oauth configured http endpoint null org.apache.synapse.endpoints.auth.AuthException: Error while accessing the Token URL. HTTP/1.1 400 Bad Request, code = 303003, detail = Could not generate access token for oauth configured http endpoint null org.apache.synapse.endpoints.auth.AuthException: Error while accessing the Token URL. HTTP/1.1 400 Bad Request, exception = Could not generate access token for oauth configured http endpoint null org.apache.synapse.endpoints.auth.AuthException: Error while accessing the Token URL. HTTP/1.1 400 Bad Request [2023-11-29 14:17:23,688] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - APIGW-Exception:Invalid body field: residentialSwitchMatchRequest.services[0].action,APIGW-Exception-Code:24,APIGW-Exception-System:APIGW,Connection:keep-alive,Content-Length:95,Content-Type:application/json,Date:Wed, 29 Nov 2023 14:17:23 GMT,scope:api://totsco.3dflyingmonsters.co.uk/.default, Unexpected error sending message back org.apache.axis2.AxisFault: Transport out has not been set at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:432)
we are trying to generate the token here we are using client credentials grant type. but log states "Could not generate access token for oauth configured http endpoint null org.apache.synapse.endpoints.auth.AuthException: Error while accessing the Token URL. HTTP/1.1 400 Bad Request"
we are able to generate tokens for other customers but for this customer we are getting issue.