Account Switcher for WebCentral
Install Account Switcher on Windows Server
Verify the zip, install the AccountSwitcher Windows service, put config, TLS, policy and licence under ProgramData and publish the two hostnames through nginx for Windows with oauth2-proxy.
Last updated
Account Switcher for WebCentral 1.0.3 runs on Windows Server 2022 and Windows 11 x64 as the Windows service AccountSwitcher. Before you start, ask your DBA to complete the SQL steps in the admin guide. You also need the licence file account-switcher.ismlic from ISM.
| Item | Location |
|---|---|
| Program files | %ProgramFiles%\ISM\AccountSwitcher\<version> |
| Data folder (config, TLS, policy, licence) | %ProgramData%\ISM\AccountSwitcher |
| Log | %ProgramData%\ISM\AccountSwitcher\logs\switcher.log |
| Start failures | Application event log, source AccountSwitcher |
| Service account | NT SERVICE\AccountSwitcher (virtual account) |
1. Check the package
Download webcentral-switcher-<version>-windows-amd64.zip and SHA256SUMS from the release. In PowerShell:
Get-FileHash -Algorithm SHA256 .\webcentral-switcher-<version>-windows-amd64.zip
The hash must match the zip’s line in SHA256SUMS. Then unpack the zip.
2. Install the service
In an elevated PowerShell, in the unpacked folder, for Windows integrated authentication (recommended):
powershell -ExecutionPolicy Bypass -File .\packaging\windows\install.ps1 -SqlServer <sql-host>:1433 -Database HQ
The service’s virtual account uses the machine account on the network, so your DBA creates the switcher_service SQL login for the machine account DOMAIN\HOST$. No secret is stored.
If you must use a SQL login, add -SqlUser <login>:
powershell -ExecutionPolicy Bypass -File .\packaging\windows\install.ps1 -SqlServer <sql-host>:1433 -Database HQ -SqlUser switcher_service
The installer asks for the password with a hidden prompt. For unattended installs, use -SqlPasswordFile <file> instead, and delete the file afterwards. Never put the password on the command line.
The installer:
- refuses an install folder, or any parent of it, that non-administrators can modify;
- copies the binaries to
%ProgramFiles%\ISM\AccountSwitcher\<version>; - sets the data folder
%ProgramData%\ISM\AccountSwitcherto exactly SYSTEM, Administrators and the service account, and resets every file inside it to those permissions; - registers the
AccountSwitcherservice to run asNT SERVICE\AccountSwitcher, with restart on failure; - stores the SQL connection for the service only. With a SQL password, the service’s registry key is restricted to SYSTEM and Administrators.
Add -Start to start the service as soon as it is installed.
3. Add configuration, certificates, policy and licence
Put these files in %ProgramData%\ISM\AccountSwitcher:
config.json, started fromconfig.example.json, with Windows paths (see below);- the TLS server certificate and key, and the gateway client CA;
policy.json(see the admin guide);- the licence
account-switcher.ismlic, withism.account-switcher.licence.dirset to this folder.
{
"listen": "127.0.0.1:8443",
"tls_cert_file": "C:\\ProgramData\\ISM\\AccountSwitcher\\tls\\server.pem",
"tls_key_file": "C:\\ProgramData\\ISM\\AccountSwitcher\\tls\\server-key.pem",
"client_ca_file": "C:\\ProgramData\\ISM\\AccountSwitcher\\tls\\gateway-ca.pem",
"admin_origin": "https://admin.switcher.example.invalid",
"impersonation_origin": "https://imp.switcher.example.invalid",
"admin_group": "SwitchAdmins",
"project_id": "HQ",
"webcentral_url": "http://127.0.0.1:8080",
"ism.account-switcher.licence.dir": "C:\\ProgramData\\ISM\\AccountSwitcher",
"policy_file": "C:\\ProgramData\\ISM\\AccountSwitcher\\policy.json",
"kill_switch_file": "C:\\ProgramData\\ISM\\AccountSwitcher\\KILL-SWITCHING"
}
The other keys are the same as on Linux (see the Linux guide). Private files must be readable only by the service account, SYSTEM or Administrators, or the service refuses to start. Files you create in the data folder inherit the correct permissions.
Private SQL CA: Account Switcher always validates the SQL Server TLS certificate. If SQL Server uses a certificate from a private CA, import that CA into Cert:\LocalMachine\Root.
4. Start and check
Start-Service AccountSwitcher
Get-Service AccountSwitcher
The status should be Running. If it is not, read %ProgramData%\ISM\AccountSwitcher\logs\switcher.log or the Application event log (source AccountSwitcher).
Licence: the service refuses to start if the licence is missing, unreadable, altered, expired, for another product or for another customer. It logs a clear message, writes an event log entry and exits with an error.
5. Publish through nginx for Windows and oauth2-proxy
Account Switcher listens on loopback only. Publish two different HTTPS hostnames (admin picker and switched sessions) through nginx for Windows with oauth2-proxy. Start from packaging\windows\nginx-windows.oauth2-proxy.example.conf. The gateway:
- signs the administrator in through your OIDC provider (oauth2-proxy runs as its own service on 127.0.0.1);
- removes identity headers sent by the browser;
- sends exactly one
X-Switcher-Actor,X-Switcher-GroupsandX-Switcher-Projectheader; - connects to Account Switcher with the client certificate pinned in
proxy_cert_sha256.
Keep the gateway certificates in a folder such as C:\nginx\conf\switcher\, readable only by SYSTEM, Administrators and the account nginx runs as.
IIS is not supported as the gateway, because it cannot present the pinned client certificate to Account Switcher.
Never expose the switcher’s port or WebCentral’s private port directly.
Kill switch, upgrade and removal
- Stop switching now:
New-Item "$env:ProgramData\ISM\AccountSwitcher\KILL-SWITCHING". Delete the file to resume. - Upgrade: back up the WebCentral database (including
switcher.audit), then runinstall.ps1from the newer package. It stops the service, points it at the new version folder and keeps the previous one. - Remove:
powershell -ExecutionPolicy Bypass -File .\packaging\windows\uninstall.ps1, adding-RemoveBinariesto delete the program files too. The data folder and all SQL objects, includingswitcher.audit, are kept.
Done When
- Get-FileHash matches the zip's line in SHA256SUMS.
- Get-Service AccountSwitcher shows Running.
- Both hostnames are served only through nginx for Windows with oauth2-proxy.