This sample validates and changes Facebook account passwords by replaying Facebook's browser-based login and security forms. It is a form-scraping example for sites that do not expose a supported administrative API.
Platform Script: CustomFacebook.json
Facebook user accounts accessed through the public web interface.
| Operation | Description |
|---|---|
CheckPassword |
Opens the Facebook login form, submits the managed account credentials, and succeeds only when the redirect pattern indicates a normal authenticated session. |
ChangePassword |
Signs in with the current password, opens the security/password page, submits the password-change form, logs out, and verifies the new password by logging in again. |
- Outbound HTTPS access from SPP to
https://www.facebook.com - The managed account must use password-based sign-in only; checkpoint, login approvals, MFA prompts, or CAPTCHA must be disabled
- Managed account username/email and current password; no separate service account is required
- Upload the script:
Import-SafeguardCustomPlatformScript -FilePath ./CustomFacebook.json - Create a custom platform using this script
- Create an asset using the platform
- Configure the managed account(s); no separate service account is required
- Test with
Test-SafeguardAssetAccountPassword -ExtendedLogging
The script fetches the no-script Facebook login page, extracts the login form, and posts the supplied credentials. For password change, it navigates to the security settings page, fills in the current, new, and confirmation password fields, submits the form, logs out, and then signs in again with the new password to confirm the rotation succeeded.
Timeout: Optional operation timeout in seconds. Default:30.AssetName: Friendly name used in status messages. Default:Facebook.
- This sample depends on Facebook's current HTML form fields and redirect behavior, so UI changes can break it without warning.
- It does not handle checkpoint flows, login approvals, MFA, CAPTCHA, or other interactive challenges.
ChangePasswordreturnsfalseif the current and new password are identical.