question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manage users in Cognito using admin actions

See original GitHub issue

Admin actions allows us to quickly generate an API for managing Cognito users and groups. The goal of this issue is to discuss how we could make react-admin-amplify communicate with that API.

The way I see it right now is:

  • Define a resource name like cognitoUsers
  • Edit the data provider so when it sees that resource name is cognitoUsers, it calls the admin API instead of the GraphQL API.
  • Same thing with cognitoGroups

From here, we can easily list users and groups and display one user and one group.

In order to avoid people to always look for available fields we could create 4 components:

CognitoUserList CognitoUserShow CognitoGroupList CognitoGroupShow

and since there is no update or delete, we could create two resources: CognitoUserResource and CognitoGroupResource that are only implementing list and show.

That would be a good start. But we could go further 🙂

What would be nice is to also create something like react-admin ShowButton, but the actions would be for each user:

confirmUserSignUp disableUser enableUser

other actions like addUserToGroup are more complex because they require a form, so we will have to create a custom route that is displaying a form and manage this form submit. I did something similar in a project and could do this easily.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
MrHertalcommented, Feb 17, 2021

I have completed the first part which was displaying users and groups: https://github.com/MrHertal/react-admin-amplify/releases/tag/v1.3.0

1reaction
MrHertalcommented, Aug 8, 2021

Hi @a93h

II will try to support this library as long as I can.

I don’t have time currently to add this feature. If you want to add it, I will be pleased to review your PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing and searching for user accounts - Amazon Cognito
Go to the Amazon Cognito console . · Choose User Pools. · Choose an existing user pool from the list. · Choose the...
Read more >
Authentication - Admin actions - AWS Amplify Docs
Admin Actions allow you to execute queries and operations against users and groups in your Cognito user pool. For example, the ability to...
Read more >
Creating user accounts as administrator - Amazon Cognito
Create a new user profile by using the Amazon Web Services Management Console or by calling the AdminCreateUser API. Specify the temporary password...
Read more >
AWS-Cognito: How to assign user roles in the user pool?
The super admin role is responsible for adding/deleting/editing the users. Is there any way to do this just by using userPool features ?...
Read more >
admin-create-user — AWS CLI 2.9.8 Command Reference
You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminCreateUser API action, Amazon Cognito invokes the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found