Skip to content

Instantly share code, notes, and snippets.

@phi1ipp
Last active January 27, 2021 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phi1ipp/fdc5e4094276d9fa956c02d166d2416e to your computer and use it in GitHub Desktop.
Save phi1ipp/fdc5e4094276d9fa956c02d166d2416e to your computer and use it in GitHub Desktop.
Provision Okta AppUser with external id #okta
OKTA_DOMAIN="your.okta.domain"
APP_ID="xxxxxxxxxxxxxxx"
while read -r line;
do
data="{
\"id\": \"$line\",
\"scope\": \"USER\",
\"profile\": {
\"externalId\": \"$line\"
},
\"credentials\": {
\"userName\": \"$line\"
}
}"
curl -X POST "https://${OKTA_DOMAIN}/api/v1/apps/${APP_ID}/users" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: SSWS xxxxxxxxxxxx-xxxxxxxxxxxxx' \
--data-raw $data
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment