0

I'm working on a project to automate the steps in the Google Article Maintain data security after an employee leaves and have encountered trouble with automating the step Revoke Recovery Password Access. I'm following the documentation on the Google API Explorer for Updating Users and am performing an API request to the endpoint PUT https://admin.googleapis.com/admin/directory/v1/users/{userKey} with the following JSON as the body:

{
 "recoveryEmail": null,
 "recoveryPhone": null
}

I receive a 200 response code with no error but email and phone number remains. If I try some dummy data (such as below) then the information updates fine:

{
 "recoveryEmail": "joe@bloggs.com",
 "recoveryPhone": "+1234567890"
}

I also tried:

{
 "recoveryEmail": "",
 "recoveryPhone": ""
}

Ideally I would like to clear the data rather than overwriting it with dummy values.

1 Answers1

0

If you have a Google Workspace account, I think the problem may be related to propagation. I have tested it myself before, using the following, and it worked:

{
    "recoveryEmail": "",
    "recoveryPhone": ""
}

This Help Center article mentions that the changes on users can take some time to appear https://support.google.com/a/answer/7514107

I have just tested it again and it worked. I would suggest checking the user information in an incognito or private browser window, or wait up to 24-48 hours due to propagation time.

J.M. Janzen
  • 671
  • 1
  • 8
  • 19
Fernando Lara
  • 2,263
  • 2
  • 4
  • 14
  • Still not working for me. Not related to propagation. I tried: { "recoveryEmail": "", "recoveryPhone": "+442000000000" } And the phone number updated but the e-mail address refused to clear (old e-mail address value remained). – Michael Aumeerally Feb 02 '22 at 17:44
  • I also tried with two different Google tenants – Michael Aumeerally Feb 02 '22 at 17:47
  • Are you using the users.patch or the users.update method? The patch one will not remove the previous information and will add the new one along with it, however the update method does remove the previous info. – Fernando Lara Feb 02 '22 at 18:46
  • Yes I'm using HTTP PUT instead of PATCH. I presume that is the only difference or am I missing here? – Michael Aumeerally Feb 04 '22 at 10:51
  • Ok I tried via Google API Explorer and Postman and it works. So this looks like to an Okta Workflows problem. Weird as I'm submitting the same JSON on all three methods and they will overwrite with new info just fine; just the Okta Workflows won't clear the values. At least I have enough info to raise a support ticket with Okta. – Michael Aumeerally Feb 04 '22 at 12:25
  • That is correct. If everything works fine in the API explorer, then most likely the issue is related to any other tool since the API is working from Google's side. I definitively think that opening a support ticket is the way to go. – Fernando Lara Feb 04 '22 at 15:13