cloudfront-auth
cloudfront-auth copied to clipboard
Issues configuring auth with google
I configured a website according to the documentation using Google to authenticate and now I'm getting this error after I sign in to my account.
The Lambda function returned invalid json: The json output must be an object type.
If you received this error while trying to use an app or access a website, please contact the provider or website owner for assistance.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by following steps in the CloudFront documentation (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-502-bad-gateway.html).
has this ever happened to you?
Thank you!
Hmmm... the first thing would be to check the logs to see where in the process this happened. I've had 502 errors before, but I don't recall this specifically.
AFAIK there were no logs at all. I finally run the build script again with different options and worked fine. the options that did't work for me was to authenticate against google and provide a list of valid emails.
I see. I will have to give that method a closer look. Admittedly, that one doesn't get as much attention as the others, so it's possible there's an issue there.
If you enable logs, you should see some form of output in CloudWatch for the corresponding log stream.
We are having the same error when using the list of valid emails in Google Authentication Errors from the lambda logs are:
2019-06-18T10:07:25.762Z 57428f26-843e-402c-b169-5730db1e12f3 (node:1) UnhandledPromiseRejectionWarning: TypeError: callback is not a function
at internalServerError (/var/task/index.js:350:3)
at /var/task/auth.js:13:7
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
2019-06-18T10:07:25.762Z 57428f26-843e-402c-b169-5730db1e12f3 (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)
This is an old thread, but I just hit this issue with a specific user, did you ever have an answer as to what caused this @Isaacpm