3
votes

I am using Google Admin SDK Directory API to create users and using Service account I am able to perform CRUD operations on them.

I have a requirement whereby I have to check the credentials of users created using SDK. When you fetch the users the password is not returned, hence comparison cannot be done.

I'll really appreciate if someone lets me know what would be effective way of approaching the checkCredentials function.

Thanks.

2
Why do you need to "check" a user password when you've clearly already set it when creating the user? What are you checking for?Jay Lee

2 Answers

2
votes

Google does not ever return the value of the password. That would be a monumental security risk.

See their documentation in regards to the user resource used in the directory API. It specifically states that the password field is never returned. It can only be used for setting the password.

If your requirement is too check creds on a newly created user, you should look into trying to login as the user with the password you just sent, using the google auth Apis

0
votes

At the moment, the only solution I've found is to simulate the user login flow with a fake browser (Apache's httpcomponents-client for Java for example) pointing to Google Account ServiceLogin.