I am trying to create a static website in S3 (with CloudFront) that uses Auth0 in order to authenticate users in to the site. I have seen most of the samples out there of what the Lambda@Edge login script might look like, but I can’t get any of them to actually work. I couldn’t get any of these to function properly:
I have seen some of the examples on github but am struggling to get any of them to work:
/experoinc/aws-lambda-edge-oauth
/martzmakes/blog-cdk-cloudfront-edge-auth0
Wondering if anyone has a good, basic working example of the login process for Auth0 in Lambda@Edge (node.js environment)?
Hi @nickycupcakes
Welcome to the Auth0 Community!
I am sorry about the delayed response to your question!
As mentioned in this community post:
Unfortunately there’s no direct plugin or plug-and-play solution for integration between you AWS Lambda@edge application and Auth0, however from the post-login action (for example) you are able to make an HTTP request for the lambda@edge endpoint. Please make a note that this action will be handled between Auth0 Action server and Lambda@edge application, so client browser will be omitted during this transaction. The response can be later passed to the client via id or access token claims.
Also, you can take a look at this open source Github Repository regarding user authorization using Auth0 and Lambda@Edge.
Kind Regards,
Nik