Server-less HTTP API is not working with Okta OIDC Application

I created an Okta application(oidc openID–> Web Application) that is redirecting

Sign-in redirect URIs https://.amazonaws.com/dev/authorization-code/callback

Created a serverless HTTP API to listen to the callback something like below:
serverless.yml

functions:
  auth:
      handler: src/handler.auth
      events:
        - http:
            path: authorization-code/callback/
            method: get

handler.js

module.exports.auth = async (event, context, callback) => {
  const userinfo = event.userContext && event.userContext.userinfo; // not getting this userinfo here
  const response = {
    statusCode: 301,
    headers: {
      Location: "rediretion url",
    },
    body: userinfo
  };
  callback(null, response);
};

I am expecting this /authorization-code/callback should return user information to me.

My findings I checked in node js express API provided into a doc is working fine for me.

app.get('/', (req, res) => {
  if (req.userContext.userinfo) {
    res.send(`Hi ${req.userContext.userinfo.name}!`);
  } else {
    res.send('Please Sign In');
  }
});

But my business need is to handle in serverless only.

Any help will unblock me to proceed with the task.

Looks like the same question is asked over here, Serverless http api is not receiving user information in redirect callback, so I’m going to close this one as a duplicate