-
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
Error "No Credentials" when using auth mode: "iam" #12985
Comments
after enabling
same error as in #12931 |
In case anyone else runs into this, not sending an Authorization when making an This conflicted with some other code that I saw in another issue. Hopefully this helps someone else who came across this!
instead of
|
Hi @asp3 while you are enabling Looking the code path that throws "No Credentials", it's typically due to the fetchAuthSession cannot retrieve credentials from user pool while there is no user signed in and the user pool has not enabled unauthenticated access. |
@HuiSF Yep, our cognito has had it enabled since we began (we have been using amplify for a few years now), its all working for me now again with v6. From what I can see, it seems the issue was 2 fold. The initial "No Credentials" error was solved by adding This was due to the fact that I needed
However, in this scenario, for unauth users, it would pass headers as:
but since the key was present, I assume it thought it was still in the
|
@asp3, quick follow up question for you on this. Is there a section of the docs that you feel could have expanded on this since you've just gone through it seeking the answer? Want to see if we can ensure this confusion can be prevented for future readers if possible. Thanks! |
To answer the question, since I also ran into this and wasted almost an entire day troubleshooting. Not sending the Auth header to make public guest access with iam work should be mentioned somewhere around here in the docs. |
Before opening, please confirm:
JavaScript Framework
React Native, Next.js
Amplify APIs
Authentication, GraphQL API
Amplify Version
v6
Amplify Categories
auth, api
Backend
Amplify CLI
Environment information
Describe the bug
All authenticated calls work perfectly with the new v6 library, as the Authorization header is set. However, when trying to make unauthorized calls with
authMode = "iam"
, we run into the error as described.Expected behavior
I would expect IAM calls work as they did with the previous library, and are able to be made.
Reproduction steps
Verified from my end that the issue is that the call is never even made, not that the connected resolver is rejecting this request.
Code Snippet
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: