You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method fetchUserAttributes currently performs a Cognito SDK API call which therefore requires the scope aws.cognito.signin.user.admin
This is unnecessary and imo not great security wise as the aws.cognito.signin.user.admin scope allows access to ANY control plane operation that accepts an Access Token
Cognito has OAUTH endpoints that will return the same userprofile information at /oauth2/UserInfo this will return all user attributes the access token has access to - requiring only the profile scope and perhaps email and phone scope depending on what attributes are needed to be retrieved.
Expected behavior
Able to call fetchUserAttributes without setting the scope aws.cognito.signin.user.admin as that scope should not be required to just fetch user attributes.
Reproduction steps
call fetchUserAttributes without the admin scope - see that the Cognito control plane API is hit vs the oauth API
Code Snippet
// Put your code below this line.
Log output
// Put your logs below this line
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:
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
The method
fetchUserAttributes
currently performs a Cognito SDK API call which therefore requires the scopeaws.cognito.signin.user.admin
This is unnecessary and imo not great security wise as the
aws.cognito.signin.user.admin
scope allows access to ANY control plane operation that accepts an Access TokenCognito has OAUTH endpoints that will return the same userprofile information at
/oauth2/UserInfo
this will return all user attributes the access token has access to - requiring only theprofile
scope and perhapsemail
andphone
scope depending on what attributes are needed to be retrieved.Expected behavior
Able to call
fetchUserAttributes
without setting the scopeaws.cognito.signin.user.admin
as that scope should not be required to just fetch user attributes.Reproduction steps
call
fetchUserAttributes
without the admin scope - see that the Cognito control plane API is hit vs the oauth APICode 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: