I will summarize my workflow as follow:
- One client Application (Mobile or Web Application)
- Users will login these clients by calling a Lambda function Login via API Gateway
- Within Login Lambda function, it will call Keycloak RestAPI to retrieve the token
I have a problem in step 3 which cause the Timeout all the time.
My Lambda Function built by Nodejs 20.x, no VPC setup
My Keycloak Server containerize on Rancher with version 25.0.0
I also test with some other dummy APIs, and they work successfully even with Lambda calling or Postman calling.
I use Axios to call Rest API, and this the error message I received:
“{“message”:””,”name”:”AggregateError”,”stack”:”AggregateErrorn at AxiosError.from (file:///opt/node_modules/axios/lib/core/AxiosError.js:89:14)n at RedirectableRequest.handleRequestError (file:///opt/node_modules/axios/lib/adapters/http.js:610:25)n at RedirectableRequest.emit (node:events:519:28)n at eventHandlers. (/opt/node_modules/follow-redirects/index.js:38:24)n at ClientRequest.emit (node:events:519:28)n at TLSSocket.socketErrorListener (node:_http_client:500:9)n at TLSSocket.emit (node:events:519:28)n at emitErrorNT (node:internal/streams/destroy:169:8)n at emitErrorCloseNT (node:internal/streams/destroy:128:3)n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)n at Axios.request (file:///opt/node_modules/axios/lib/core/Axios.js:45:41)n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)n at async Runtime.handler (file:///var/task/index.mjs:24:26)”,”config”:{“transitional”:{“silentJSONParsing”:true,”forcedJSONParsing”:true,”clarifyTimeoutError”:false},”adapter”:[“xhr”,”http”],”transformRequest”:[null],”transformResponse”:[null],”timeout”:0,”xsrfCookieName”:”XSRF-TOKEN”,”xsrfHeaderName”:”X-XSRF-TOKEN”,”maxContentLength”:-1,”maxBodyLength”:-1,”env”:{},”headers”:{“Accept”:”application/json, text/plain, /“,”Content-Type”:”application/x-www-form-urlencoded”,”User-Agent”:”axios/1.6.8″,”Content-Length”:”94″,”Accept-Encoding”:”gzip, compress, deflate, br”},”method”:”post”,”url”:”https://domain.example/realms/master/protocol/openid-connect/token”,”data”:”grant_type=password&client_id=admin-cli&scope=openid&username=john.doe&password=P%40assword”},”code”:”ETIMEDOUT”,”status”:null}”
Codee Madness is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.