curl -X POST "https://dev.abdm.gov.in/gateway/v0.5/sessions" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"clientId\":\"SBX_002648\",\"clientSecret\":\"XXXX-XXXX....\"}"
above curl is generated by swagger doc and the curl will work from terminal but doesn’t work when request executed from swagger doc itself. when making a request from my REST client in code it won’t work from there as well and will give 401 error with null response body.
Following is the log of the request in code:
Request: POST https://dev.abdm.gov.in/gateway/0.5/sessions
Headers[Accept=application/json Content-Type=application/json User-Agent=Resteasy Reactive Client content-length=79],
Body:
{"clientId":"SBX_002648","clientSecret":"XXXX-XXXX..."}
2023-02-17 20:06:51,045 DEBUG [org.jbo.res.rea.cli.log.DefaultClientLogger] (vert.x-eventloop-thread-0)
Response:
POST https://dev.abdm.gov.in/gateway/0.5/sessions, Status[401 Unauthorized],
Headers[www-authenticate=Basic realm="Realm" cache-control=no-cache,
no-store,max-age=0, must-revalidate pragma=no-cache expires=0
x-content-type-options=nosniff strict-transport-security=max-age=31536000 ;
includeSubDomains x-frame-options=DENY x-xss-protection=1 ; mode=block
referrer-policy=no-referrer content-length=0 x-envoy-upstream-service-time=3
date=Fri, 17 Feb 2023 14:36:50 GMT
Set-Cookie=TS011c04bd=01445fed04ccc8a6129801edd8929277b58e942162b3f883caa4f4824b50e85ef34d9a3c94ac4375a68cc2cbccfcc0d48256187fe4; Path=/],
Body:
Am I missing something here? Please help me on this as am stuck on this for a while. I am using Quarkus Rest Client library to make requests. This library has worked for other services we are using but not able to understand why it is not working here.