Search code examples
phpgoogle-apigoogle-api-php-clientgoogle-workspacegoogle-directory-api

Get All Users password of Google Apps Account Using PHP Client Library


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


Solution

  • 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.