BinghamtonUniversity / IAMBing

A Highly Configurable Identity & Access Management (IAM) Engine
MIT License
3 stars 0 forks source link

Investigate API for Restoring Deleted Google Accounts #33

Open timcortesi opened 2 years ago

timcortesi commented 2 years ago

@alikemaltanriverdi -- please investigate:

It looks like it is possible to query google in such a way that it includes deleted accounts: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin Looks like you add: showDeleted=true

It also looks like you should be able to see if a user is deleted: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users "deletionTime": string,

It also looks like there is an undelete API to undelete users: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/undelete

So ... When creating or updating a google account, we should see if that account was deleted. If the account was deleted, instead of creating a new account, we should undelete it and then update it accordingly.

alikemaltanriverdi commented 2 years ago

Due to a bug in Google's API (https://issuetracker.google.com/issues/179777261), we cannot specify the email we're looking for when listing the deleted accounts in Google. This might be resolved when the Google API bug is resolved.