Using Web Services Impersonation via the SOAP API

Overview

Secret Server supports a delegated trust model that lets an application (API) account act on behalf of an individual Secret Server user when accessing the product programmatically. Instead of granting the API account direct, blanket access to every secret, the account temporarily impersonates a specific user and is therefore limited to exactly the secrets and folders that user can already see. This applies to both on-premises and cloud installations.

This is the mechanism behind third-party integrations such as the BeyondTrust Remote Support / Representative Console integration, where a credential is injected into a remote session without ever being exposed to the human operator.

Two things work together to make this safe:

  1. The Web Services Impersonate role permission—controls which API accounts are allowed to attempt impersonation at all.
  2. A per-user device approval workflow—gives each end user the ability to explicitly approve, deny, or later revoke an application's right to impersonate them.

The Web Services Impersonate Permission

The role permission is defined as:

"Allows a user to send an approval request to act as another user within their organization when accessing Secret Server programmatically. Administrators do not have this permission by default."

Key points:

  • It is a role-level (organization-wide) permission, not a per-secret permission.
  • It is not granted to Administrators by default—it must be explicitly assigned to the role used by the integration's application account.
  • Holding the permission does not by itself grant access to any user's secrets. It only allows the account to request impersonation; the target user (or a configured exception) must still authorize it.

How Impersonation Works End to End

The integration communicates with Secret Server through the SOAP web service (SSWebservice.asmx). A typical flow:

  1. Authenticate—The application account authenticates with its own credentials and receives a primary auth token.
  2. ImpersonateUser—The integration calls ImpersonateUser, naming the end user it wants to act as. Secret Server checks that the calling account holds the Web Services Impersonate permission. (Impersonating while already impersonating—"double impersonation"—is rejected, as is attempting to impersonate yourself.)
  3. Delegated trust check (Device)—Secret Server represents each application account → end user pairing as a Device of type Application Integration. The device identity is derived from both user IDs, so consent is scoped to that specific pairing.

    • If the device is already approved: a delegated token is issued immediately. This token carries both the application account and the impersonated user, and the action is written to the audit log.
    • If the device is new / pending: access is refused, and an email is sent to the end user asking them to approve the request. The response includes a link to the approvals page.
  4. Access secrets as the user—Once a delegated token is held, the integration searches for and retrieves secrets as the impersonated user, bounded entirely by that user's existing permissions, then checks the secret back in when finished.

Approving, Denying, and Revoking Access

When an impersonation request is pending, the end user receives an email and can manage the request from the approvals area of the Secret Server UI (reachable in some integrations' documentation as Tools > Manage Applications, and in the modern UI at the Inbox Approvals view).

Example: the Default Request Email

By default, the end user receives an email like the following (the wording can be customized per installation):

Subject: Application "{application name}" is requesting access to Secret Server

An Application {application name} is requesting access to Secret Server on your behalf.

Click the link to go to Secret Server to approve or deny request: {approval link}

The email is built from values that vary by environment:

  • {application name}—the requesting application's name, taken from the integration's device/display name (for example, the application account's display name).
  • Secret Server—the configured product name (substituted from the application name setting; appears wherever the product is referenced).
  • {approval link}—points to the Inbox Approvals view (.../app/#/inbox/view/approvals).

Following the link takes the user to the page where they approve or deny the request.

From there the user can:

  • Approve the request—the device becomes Approved and future impersonation succeeds without re-prompting.
  • Deny the request—the device is Rejected.
  • Revoke previously granted access at any time by denying (rejecting) a device that was previously approved. There is no separate "revoke" action—revocation is simply a deny applied to an approved device.
Only the impersonated (target) user can approve, deny, or revoke a request for their own account; another user attempting to act on the request is refused. All approve/deny/revoke actions are written to the audit log.

Configuration Checklist

Before an integration can use impersonation, confirm the following in Secret Server:

  • Enable Web Services—In Admin > Configuration > General, set Enable Webservices to Yes.
  • Application account—Create or designate a dedicated application account for the integration.
  • Assign the permission—Ensure the application account's role includes Web Services Impersonate (sometimes shown simply as Impersonate). Remember it is not on the Administrator role by default.
  • Secret and folder access—The end users being impersonated must have access to the relevant secrets; the application account itself does not need direct secret access, because it operates as the user.

Special Case: Impersonating an Application Account

When the user being impersonated is itself an application account (rather than an interactive user), there is no person to email for approval. In that case:

  • Approval is granted automatically, but only if the target application account has IP address restrictions configured.
  • If the target application account has no IP address restrictions, the impersonation request is refused. This prevents silent, unrestricted account-to-account impersonation.

REST Endpoints for Managing Requests

Application access requests can also be managed via REST. Each endpoint is also exposed under a winauthwebservices/... alias for the Windows Authentication site.

  • GET /api/v1/application-access-requests—list the current user's application access requests (filterable by status).
  • GET /api/v1/application-access-request/{deviceId}—get a specific request.
  • PATCH /api/v1/application-access-request/{deviceId}—approve or deny a request (deny an approved request to revoke it). Only the impersonated user may update their own request.
  • GET /api/v1/application-access-request-audits—retrieve the approval/denial audit history.

Notes and Caveats

  • The delegated token is scoped to the impersonated user's own permissions—impersonation never widens access beyond what that user already has.
  • For Secret Server Cloud, ensure the SOAP endpoint URL does not include an extra /SecretServer/ path segment (correct form: https://<tenant>.secretservercloud.com/webservices/SSWebservice.asmx). On-premises installs using a /SecretServer/ virtual directory may require the longer path.
  • Auth tokens are cached and reused within a session flow; if a token's lifetime is exceeded, calls fail and the integration must re-authenticate. Review the Session Timeout setting if long sessions fail mid-flow.