Closed clintagossett closed 1 year ago
@chrisbonifacio , I've been doing some more testing and realised there was a difference between "User 1" and "User 2".
User 1 was assigned a group.
User 2 had no groups assigned.
When I removed all groups from User 1, authentication worked.
This behavior is contrary to what's expected as "authenticated users" should include all users assigned to groups. Let me know if I should resubmit to another channel.
Hi @clintagossett , there seems to be a distinction between "authenticated" user and "user pool group" users in our documentation.
Amplify CLI allows you to restrict REST API access to
See a description of these user types below
User type | Description |
---|---|
Authenticated user | User needs to sign in to use the REST API |
Guest user | User doesn't need to sign in to use the REST API |
User Pool Group | User needs to sign in and belong to the User Pool Group to use the REST API |
When you try updating the REST API via the Amplify CLI, you should three options when prompted to restrict access:
Here you can choose Both
, and then you can grant access and permissions to both authenticated users and individual groups.
Let me know if this helps!
Hi @chrisbonifacio , yes, that works. I was confused as I thought "Authenticated user" would include those users who are included in a group. Apparently this is not the case. We can close this. Thanks so much for your attention here.
Hi @clintagossett , there seems to be a distinction between "authenticated" user and "user pool group" users in our documentation.
Amplify CLI allows you to restrict REST API access to
- Only authenticated users; or
- Authenticated and Guest users
- User Pool Groups
See a description of these user types below
User type Description Authenticated user User needs to sign in to use the REST API Guest user User doesn't need to sign in to use the REST API User Pool Group User needs to sign in and belong to the User Pool Group to use the REST API When you try updating the REST API via the Amplify CLI, you should three options when prompted to restrict access:
Here you can choose
Both
, and then you can grant access and permissions to both authenticated users and individual groups.Let me know if this helps!
I am encountering a peculiar case where I don't get offered this option (groups or both). Here's what I get:
For context: the user pool I am using is one that I imported not one generated by the cli. Does that explain this behavior? In all other aspects it's a setup similar to the one described by the OP.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
REST API
Amplify Categories
auth, function, api
Environment information
Describe the bug
Discussed with Chris on Discord Office Hours
We recently introduced a new REST api into our amplify application using
When I attempt to access the API with a user who registered before the API was introduced, they get an "Error: Request failed with status code 403" response.
When I create a new user, they get a 200 success response.
If I remove "Restrict API Access" everyone can use the API.
How can I resolved this issue for my existing users?
REQUEST HEADERS FOR (PRE-API USER): 403 RESPONSE
REQUEST HEADERS FOR (POST-API USER): 200 RESPONSE
Expected behavior
I expect all users to be able to authenticate with the request.
Reproduction steps
Code Snippet
Log output
aws-exports.js
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