Coder Social home page Coder Social logo

Comments (6)

KoldBrewEd avatar KoldBrewEd commented on August 28, 2024

Can you confirm you redeployed your API after you reset the CORS configuration? Unfortunately I could not replicate the problem.

from aws-cognito-apigw-angular-auth.

KoldBrewEd avatar KoldBrewEd commented on August 28, 2024

Actually taking another look, this is not a CORS error. It's related to permissions, I suggest to enable logging in APIGW to understand the issue. Can you double check the Auth IAM role cognito is using has access to the /google path?

from aws-cognito-apigw-angular-auth.

nsrikar avatar nsrikar commented on August 28, 2024

IAM role cognito is using has access to goolge path. I tried to to enable cloudwatch in APIGW but it keeps failing with error " The role ARN does not have required permissions set to API Gateway". This happens when I try to add the ARN of the following role to the APIGW under setting. Below are the my role and policy details. What am I missing?

  1. Attached "AmazonAPIGatewayPushToCloudWatchLogs" policy under managed policies of the role under permissions tab.
  2. In policy on the same tab has the following text:
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Action": [
    "execute-api:Invoke",
    "logs:"
    ],
    "Resource": [
    "arn:aws:execute-api:ap-south-1:xxxxx/
    /GET/google",
    "arn:aws:execute-api:ap-south-1:xxxxx//POST/google",
    "arn:aws:logs:::
    "
    ],
    "Effect": "Allow"
    }
    ]
    }
  3. And the trust policy under trust relationships tab has the following text
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Sid": "",
    "Effect": "Allow",
    "Principal": {
    "Service": "apigateway.amazonaws.com",
    "Federated": "cognito-identity.amazonaws.com"
    },
    "Action": [
    "sts:AssumeRoleWithWebIdentity",
    "sts:AssumeRole"
    ],
    "Condition": {
    "StringEquals": {
    "cognito-identity.amazonaws.com:aud": "ap-south-1:xxxxxx"
    },
    "ForAnyValue:StringLike": {
    "cognito-identity.amazonaws.com:amr": "authenticated"
    }
    }
    }
    ]
    }

Could you please assist? Thanks

from aws-cognito-apigw-angular-auth.

KoldBrewEd avatar KoldBrewEd commented on August 28, 2024

Unfortunately I still cannot replicate, I was presenting on the AWS Dev Day in Melbourne yesterday and confirmed with some other developers it worked fine in their own account.

Might be a problem with permissions when the stack was created. Can you confirm it still happens if you delete the stack and create a new one following the instructions? Does the user running the cloudformation commands has permissions to create all resources?

Can you also confirm you performed the steps 5 to 7 from the README file and added the Google app ID to the Cognito Identity Pool?

from aws-cognito-apigw-angular-auth.

KoldBrewEd avatar KoldBrewEd commented on August 28, 2024

Also create a separate role for the API Gateway logs, here are some instructions https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-cloudwatch-logs/ and http://docs.aws.amazon.com/apigateway/latest/developerguide/stages.html#how-to-stage-settings-console (Item 6)

from aws-cognito-apigw-angular-auth.

KoldBrewEd avatar KoldBrewEd commented on August 28, 2024

Closing this one as I was not able to reproduce

from aws-cognito-apigw-angular-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.