Closed pontigol closed 6 years ago
Hello Pontus,
It looks like the "access_token" parameter is required for the .get_user() method.
Can you try:
from warrant import Cognito
u = Cognito('your-user-pool-id','your-client-id',
username='bob', access_token='your-access-token')
user = u.get_user(attr_map={"given_name":"first_name","family_name":"last_name"})
Hi Chris,
Thanks for the reply. That means the user from which I want information has to log in, and my api can then get the user's information. So there is no way I can get user information as an admin outside of the context of a logged-in user? And why can I access the same user information without an access token when I call get_users()
(in plural)? That seems inconsistent to me, and it is also not what it looks like in the documentation but maybe it just needs to be updated.
There's a method called admin_get_user()
with only user_pool_id
and username
parameters that will return the get_user_obj
.
Perhaps you could try:
from warrant import Cognito
u = Cognito('your-user-pool-id','your-client-id',
username='bob')
user = u.admin_get_user(attr_map={"given_name":"first_name","family_name":"last_name"})
Thanks, that did work! I am closing this issue then. I think the documentation could use some corrections on when tokens are needed and not but unfortunately I don't have time to contribute myself. Thanks again!
Hi,
When I try:
as specified in the docs I get:
get_users()
(in plural) works perfectly fine butget_user()
gives me above error. What am i doing wrong?Best regards, Pontus