How can we inject the claims through the custom authorization lambda?

0

Previously we used the authorizer type as cognitouserpool so when we send a request to the customAuthorization added API endpoint means in that API event we get the requestContext object inside authorizer object inside claims so based on that we made our applications by using inside cliams there are some user related info like "cognito:username" this is the existing process. Now I am preparing one custom authorization lambda for my nodejs API's there I want to send claims also to the respective request event i'm getting only requestContext object inside authorizer object im getting the info what i'm sending in the custom authorization lambda I want to inject the claims object also in the custom authorization.

In my custom authorization lambda Im doing first verifying the token by using with these packages 'jsonwebtoken','jwk-to-pem', after we are trying to do generate policy function inside we are sending some required info like "Action","Effect","resource" and with these "context" obj inside what we want to pass required info that use for every lambda event like username, user role etc with this approach we are able to hit the appropriate lambda but I want to inject the claims object also that should come for what API we are hitting in that API event we supposed to get the requestContext object inside authorizer object inside claims as like we are getting previously with the authorizer type of cognitouerpool related event like i want.

没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容