Skip to content

Instantly share code, notes, and snippets.

@kyouheicf
Last active March 12, 2024 15:12
Show Gist options
  • Save kyouheicf/ed76ee02413ce8b4fc7f4ab5c867c907 to your computer and use it in GitHub Desktop.
Save kyouheicf/ed76ee02413ce8b4fc7f4ab5c867c907 to your computer and use it in GitHub Desktop.
# Get current config json
http -A creds GET https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers \
| jq -r '[.result[] | select (.type == "azureAD")][0]' > azureAD.json
# Set identity UUID
export AZURE_AD_UUID=$(cat azureAD.json | jq -r .id)
# Set "prompt" config parameter option
jq 'del(.id, .uid, .version) | .config.prompt = "login"' azureAD.json > tmp && mv tmp azureAD.json
# jq 'del(.id, .uid, .version) | .config.prompt = "select_account"' azureAD.json > tmp && mv tmp azureAD.json
# jq 'del(.id, .uid, .version) | .config.prompt = "none"' azureAD.json > tmp && mv tmp azureAD.json
# Update with "prompt" config parameter option
http -A creds PUT https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers/$AZURE_AD_UUID @azureAD.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment