Overview
What is its Purpose?
- Creates username and password-based WS-Security UsernameToken and adds it to SOAP messages to provide the authentication expected by service providers.
- Ensures compliance variability with target service password policies by managing security flags such as password type, nonce, and created timestamps.
- Reduces integration errors by meeting header control requirements of consumed services through the MustUnderstand flag.
- Enhances observability by providing configurable error message and status code management for API Proxy calls.
Working Principle
- Request Arrival: For each HTTP/HTTPS request arriving at the API Gateway, the source IP address of the request is identified.
- Policy Check: If the WS Security Username Token policy is active, the system checks in the following order:
- Is a Condition defined? If so, is the condition met?
- Is the policy active (active=true)?
- Is a Variable used or is Apinizer default used?
- UsernameToken Generation: WS-Security UsernameToken is created using the username, password, and password type in the policy configuration; nonce and created fields are optionally added.
- Decision Making:
- Match Found: UsernameToken is added to the Security header of the SOAP envelope and the request is routed to the target Endpoint.
- No Match: Policy is not applied; request is forwarded with existing header contents.
- Error Handling: Customizable HTTP status code and error message are returned for requests that do not comply with the policy rule.
Features and Capabilities
Basic Features
- UsernameToken Injection: Generates and adds WS-Security UsernameToken to SOAP messages with configured username and password.
- Password Type Management: Provides appropriate encryption level for target service expectations with PasswordText or PasswordDigest options.
- Authentication Enrichment: Creates an additional security layer against replay attacks by adding Nonce and Created fields.
- Active/Passive Status Control: Easily change the active or passive status of the policy (active/passive toggle). In passive state, the policy is not applied but its configuration is preserved.
- Condition-Based Application: Determine when the policy will be applied by creating complex conditions with Query Builder (e.g., only for specific endpoints or header values).
Advanced Features
- MustUnderstand Flag Management: Triggers mandatory checks of target services by adding the mustUnderstand attribute to the WS-Security header.
- Token Creation Control: Ensures compatibility with services that perform timestamped validation thanks to the addition of the
Createdtimestamp. - Nonce Generation: Increases security against replay attacks in PasswordDigest scenarios with random nonce generation.
- Export/Import Feature: Export policy configuration as a ZIP file. Import to different environments (Development, Test, Production). Version control and backup capability.
- Policy Group and Proxy Group Support: Manage multiple policies within Policy Group. Bulk policy assignment to Proxy Groups. Centralized update and deploy operations.
- Deploy and Versioning: Deploy policy changes to live environment. See which API Proxies use it (Policy Usage). Proxy Group and Policy Group usage reports.
Usage Scenarios
Configuring Policy Parameters
In this step, users can create a new policy or configure existing policy parameters to define access rules. The defined parameters directly affect how the policy works (e.g., which IPs will be allowed, geographical restrictions, conditional activations, etc.). This allows the policy to be customized according to organization-specific requirements and managed centrally.Creating a New WS Security Username Token Policy

Configuration Steps
For the description of Conditions and Error Message Customization panels, you can review the Conditions and Error Message Customization sections on the What is Policy? page.
For a complete guide on all layers, priority order and scenario examples of the error message configuration system, see the Error Message Configuration Guide page.

