Skip to content

Instantly share code, notes, and snippets.

View ammac341's full-sized avatar

Andrew Macaulay ammac341

  • Relay Desk
  • Boston, MA
View GitHub Profile
#!/bin/bash
set -e
echo "Fetching gcloud access token..."
TOK=$(gcloud auth print-access-token)
echo "Calling Identity Platform API to enable TOTP..."
RESPONSE=$(curl -sX PATCH "https://identitytoolkit.googleapis.com/admin/v2/projects/relay-desk-8b4ed/config?updateMask=mfa" \
-H "Authorization: Bearer $TOK" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: relay-desk-8b4ed" \
-d '{"mfa":{"providerConfigs":[{"state":"ENABLED","totpProviderConfig":{"adjacentIntervals":5}}]}}' \