Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No 'Access-Control-Allow-Origin' header is present on the requested resource.when using Pinpoint with Cognito and User groups #5004

Closed
eripoll opened this issue Jul 15, 2020 · 6 comments
Assignees
Labels
pending-triage Issue is pending triage

Comments

@eripoll
Copy link

eripoll commented Jul 15, 2020

Describe the bug
I have been using Cognito and user groups without any issue for a vue-based front-end project running on Amplify with a graphql backend.
I tried adding Pinpoint using the CLI, the push seems to be creating a pinpoint resources and to be updating my Userpool but I get a "No 'Access-Control-Allow-Origin' header is present on the requested resource." when trying to record an event.

To Reproduce
Steps to reproduce the behavior:

  1. Add auth to a basic project
  2. create user groups
  3. add a user to one of the groups
  4. add pinpoint and try to record an event with an authenticated user

Expected behavior
The record should be sent to Pinpoint

Code Snippet
No specific code added

Screenshots

What is Configured?
If applicable, please provide what is configured for Amplify CLI:

in order of addition to the project

  • Auth
  • API
  • Hosting
  • Storage
  • Function
  • Analytics
@ashika01
Copy link

@eripoll : We pushed a fix for this last friday. Could try using aws-amplify packages with unstable version and let us know it fixes the CORS issue?

@eripoll
Copy link
Author

eripoll commented Jul 28, 2020

Hi @ashika01
I have just installed and tested.
Things work fine when my user is in the regular "Users" group.

However, when I login as a member of the "Administrators" group, I get the following feedback:

content-length: 290
content-type: application/json
date: Tue, 28 Jul 2020 21:59:24 GMT
status: 403
via: 1.1 5cf1e5a040860c85477a2471f3114b6b.cloudfront.net (CloudFront)
x-amz-apigw-id: QZ3lfFIoDoEFUng=
x-amz-cf-id: mWZqjOQMy6rwypURWRbI1fjp2BWH7pWq2n6hzxSgAXrTCmBEwjzY3w==
x-amz-cf-pop: CDG53-C1
x-amzn-errortype: **AccessDeniedException**
x-amzn-requestid: 91437eb4-a0b0-42b0-89c0-25858cb376a5
x-cache: Error from cloudfront

It really does seem that having Groups with Cognito does not play well with Pinpoint...
Any input on how I could solve this without mingling with CloudFormation scripts generated by Amplify?

@ashika01
Copy link

ashika01 commented Jul 28, 2020

Could you see if any of these helps or related,

I think this might be more on cli front than JS. Let me know and I can have it transferred to amplify-cli repo.

@eripoll
Copy link
Author

eripoll commented Aug 2, 2020

@ashika01 Indeed it seems related to the issues you mention.
Thanks for your help!

@ashika01 ashika01 transferred this issue from aws-amplify/amplify-js Aug 3, 2020
@edwardfoyle edwardfoyle added the pending-triage Issue is pending triage label Aug 24, 2020
@ammarkarachi ammarkarachi removed their assignment Oct 13, 2020
@ammarkarachi ammarkarachi self-assigned this Dec 8, 2020
@kaustavghosh06 kaustavghosh06 moved this from To do to In progress in Pending-triage tracking Jan 26, 2021
@ammarkarachi
Copy link
Contributor

I confirmed this closing in favor of #4772

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending-triage Issue is pending triage
Projects
No open projects
Development

No branches or pull requests

4 participants