How can I get other cognito user attributes like created_at? - amplify-js
Which Category is your question related to? Authentication
What AWS Services are you utilizing? Cognito
Provide additional details e.g. code snippets I can get the user sub, email, and other attributes like first_name by doing this
const user = await Auth.currentAuthenticatedUser()
However, I can't find any way to get the created_at datetime.
4 Answer:
@flybayer hi, the only way to achieve that data is to use the AdminGetUser
API provided by Cognito team: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminGetUser.html which is not available when using Amplify.
@flybayer you could use the admin API suggested by @powerful23 and then store the result as a custom claim in your token during the pre-token generation Cognito trigger. Then you could just access it from the token like any other claim.
@flybayer I am going to close this issue. Please let us know if you want to reopen it.
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 or Discussions for those types of questions.
Read next
- Unable to load basic assets when having a theme in place - production
- surge Detect DAW; Disable VST3 outs in FL unless you ask for them C
- Changing the DAV:displayname of the “calendar-proxy-read|-write” WebDAV resources - PHP server
- Enable payment gateway per currency - PHP invoiceninja
- Is there any way to load model except torh.hub - yolov5
- qBittorrent qBittorrent freezes when using tethered internet from android - Cplusplus
- file-type - vcard are considered as a ics calendar JavaScript
- Upload fails in image uploader - magento2 PHP