0

I know guys get account details.But if i try account details received except password.

My code is:

$optParams = array(
  //'customer' => 'www2',
  'customer' => 'my_customer',
   'maxResults' => 50,
   'orderBy' => 'email',
);
$results = $service->users->listUsers($optParams);

Please help me

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Raguvaran R
  • 177
  • 1
  • 12
  • 3
    You're trying to fetch user's passwords? Seriously? – Daan Oct 30 '18 at 11:04
  • yes, Is any problem there. If initial i want to get all my gsuite users details with their password using admin id for my own web site DB – Raguvaran R Oct 30 '18 at 11:06
  • 1
    No, you will never and should never get the passwords. They are not available to you. – Jay Blanchard Oct 30 '18 at 11:27
  • https://developers.google.com/admin-sdk/directory/v1/reference/users/update In this url update is possible . then why password retrieve not. – Raguvaran R Oct 30 '18 at 11:33
  • It's a major security risk to retrieve your users' passwords. See https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet – Tiffany Oct 30 '18 at 12:16

1 Answers1

2

A gsuite user resource does contain a password filed. However passwords are not stored clear text they are hash values. Seeing this hash value would not help you.

Even as admin of gsuite you are never going to be able to see a users password. A persons password is their own and even admins have no right seeing them.

While user update will allow you to set a users password this field is write able but that does not mean that its going to be readable.

This is clearly stated in the documentation (user resource )

The password value is never returned in the API's response body.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449