When I try to login using AWS Cognito I get an AccessDeniedException about my custom Lambda trigger

后端 未结 5 1928
走了就别回头了
走了就别回头了 2021-02-01 16:16

I am calling adminInitiateAuth and getting back a strange AccessDeniedException for my own lambdas.

Here is the code I\'m calling:

      var params = {         


        
5条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 16:47

    I had a problem similar to yours except I was trying to configure the Lambda with my Cognito User Pool through CloudFormation.

    In the link that Ryan had posted there was a code sample someone posted. Namely Cognito needed the proper permissions to invoke the lambda function.

    MyLambdaInvocationPermission:
      Type: AWS::Lambda::Permission
      Properties:
        Action: lambda:InvokeFunction
        FunctionName: !GetAtt MyLambdaFunctionName.Arn
        Principal: cognito-idp.amazonaws.com
        SourceArn: !GetAtt MyCognitoUserPoolName.Arn
    

提交回复
热议问题