-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
User Attributes (Cognito Federerated Identity) breaks the Storage component #9188
Comments
Here are the The only difference I can see are the order of the fields. User Attributes disabled (default). Working as expected.
With User Attributes enabled. Breaks the Storage object.
|
@iris-rcrimp can you provide a code snippet for your storage calls? just to see what params are passed in these calls. |
I'm having a similar issue, that may be the same issue as the one reported here. I believe these issues are at least possibly related. To reproduce, in my case:
console.log(Amplify.configure({
// eslint-disable-next-line
aws_appsync_authenticationType: 'AWS_IAM'
}));
this.imgSrc = await Storage.get(
USER_DEFAULTS.s3ProfileImageFileName,
{
download: false,
level: 'protected',
identityId: sub
} and the error shows up every time - for months now, unable to get the file. Here's the error you see in the browser's dev console (same as reported in this issue above) in response to the above call to
|
For anyone following this issue or coming across it, this should now be resolved in the latest version of v5 as well as the most recent major version of v6. Please comment back if that's not the case, but we'll close this issue as it is no longer reproducible on the latest supported versions of Amplify. |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication, Storage
Amplify Categories
auth, storage
Environment information
Describe the bug
Cognito's federated identity auth role provides access to S3 perfectly well.
To allow for fine grain access control (e.g.
user-test
can only accesss3::bucket-name/user-test
) the docs recommend user attributes (Principal Tag Attributes for access control).However, the presence of user attributes breaks
Storage
, any request (list
,get
,put
) returns the following (unhelpful) error:Expected behavior
I would expect 403 forbidden if the auth policy is setup wrong. Instead I get an error trying to read byteLength of undefined.
Reproduction steps
user attributes
to the Cognito Federated IdentityCode Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: