I have created a channel to send my app notifications when a user is updated like so:
data = { 'id': channel_id, 'type': 'web_hook', 'address': domain_address, 'kind': 'api#channel', } channel = directory.users().watch(body=data, domain=my_domain, event='update').execute()
This successfully sends notifications when I update the user in the Admin SDK GUI. However, when a user takes an action that causes their information to update, such as logging in, changing their password or enabling 2-step verification, I receive no notification.
My end goal is to receive a notification when a user enables 2-step verification, i.e. when the isEnrolledIn2Sv
attribute changes from False
to True
. Is there any way of doing this?
Thank you!
EDIT: The workaround I used was to create a webhook (I used AWS Lambda) to query all users known to have the isEnrolledIn2Sv
attribute set to False
, and see if any had changed to True
. It works! But not ideal, so would love to hear if anyone else knows a cleaner way to do this.
2-step verification adds an extra layer of security to your Google Account. In addition to your username and password, you'll enter a code that Google will send you via text or voice message upon signing in.
Manage your Google Account. At the top, tap Security. Under "Signing in to Google," tap 2-Step Verification. You might need to sign in. Tap Turn off.
In addition to 'update', it looks like you want to request 'add' events, as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With