Configure the client and provider policy set attachments
and bindings for the SAML bearer token.
Before you begin
This function is enabled in WebSphere® Application Server Version 7.0.0.7 and later releases.
To use the function, you must first install WebSphere Application Server Version 7.0.0.7
with SAML. After installing Version 7.0.0.7, you must create one
or more new server profiles, or add SAML configuration settings to
an existing profile. For example, in a WebSphere Application Server, Network Deployment environment,
there are multiple profiles. Read about setting up the SAML configuration
for more information.
About this task
WebSphere Application Server with
SAML provides numerous default SAML token application policy sets
and several general client and provider binding samples. Before you
can configure the client and provider bindings for the SAML bearer
token, you must import one of these default policy sets: SAML20 Bearer
WSHTTPS default, SAML20 Bearer WSSecurity default, SAML11 Bearer WSHTTPS
default, or SAML11 Bearer WSSecurity default. The SAML11 policy sets
are almost identical to the SAML20 policy sets, except that the SAML20
policy sets support the SAML Version 2.0 token type, while the SAML11
policy sets support the Version 1.1 token type.
A SAML token policy
is defined by a CustomToken extension in the application server. To
create the CustomToken extension, define the SAML token configuration
parameters in terms of custom properties in the client and provider
binding document. The Saml Bearer Client sample and the Saml Bearer
Provider sample general bindings contain the essential configuration
for the custom properties. The client and provider sample bindings
contain both SAML11 and SAML20 token type configuration information
and therefore can be used with both SAML11 and SAML20 policy sets.
Depending on how you plan to implement the SAML tokens, you must modify
the property values in the installed binding samples. Examples of
the properties and property values are provided in the procedure.
The
procedure for modifying the binding sample begins with configuring
the Web services client policy set attachment, and then modifies the
Web services provider policy set attachment. The example presented
in the procedure uses the sample Web services application JaxWSServicesSamples.
Procedure
- Import two default policy sets: the Username WSHTTPS default
policy set, and one of the following bearer policy sets:
- SAML11 Bearer WSHTTPS default
- SAML20 Bearer WSHTTPS default
- SAML20 Bearer WSSecurity default
- SAML11 Bearer WSSecurity default
- Click Services > Policy sets > Application
policy sets.
- Click Import.
- Select From Default Repository.
- Select the two default policy sets.
- Click OK to import the policy
sets.
- Attach a policy set for the trust
client. Click Applications > Application types > WebSphere
enterprise applications > JaxWSServicesSamples >
Service client policy sets and bindings. The
steps which pertain to attaching and detaching the policy set, and
configuring the trust client binding, are required only if an application-specific
binding is used to access the external STS. You can skip these steps,
and go to the step that discusses configuring communication with the
STS, if you use a general binding to access the external STS.
- Select the check box for the Web services client resource.
- Click Attach Client Policy Set.
- Select the policy set, Username WSHTTPS default.
This step attaches the policy set to the Web services
trust client, as you would do to use this policy set for the application
client to access the target Web services. However, since you plan
to use the Username WSHTTPS default policy set to access an external
STS instead, the policy set is only temporarily attached to the Web
services client. The purpose of this step is to allow you to use the
administrative console to create or to modify the client binding document.
- Configure the trust client binding.
- Select the Web services client resource again.
- In the Service client policy sets and bindings panel,
click Assign Binding.
- Click New Application Specific Binding to
create an application-specific binding.
- Specify a binding configuration name for the new application-specific
binding. In this example, the binding name is SamlTCSample.
- Add the SSL transport policy
type to the binding. Optionally, you can modify the NodeDefaultSSLSettings
settings. Click Security > SSL certificate and key management
> SSL configurations > NodeDefaultSSLSettings.
- Add the WS-Security policy
type to the binding, then modify the authentication settings.
- Click Applications > Application types >
WebSphere enterprise applications > JaxWSServicesSamples >
Service client policy sets and bindings > SamlTCSample >
Add > WS-Security > Authentication and protection > request:uname_token.
- Click Apply.
- Select Callback handler.
- Specify a user name and password (and confirm the password)
to authenticate the Web services client to the external STS.
- Click OK and Save.
- After the binding settings are
saved, return to the Service client policy sets and bindings panel
to detach the policy set and bindings.
- Click Applications > Application types >
WebSphere enterprise applications > JaxWSServicesSamples >
Service client policy sets and bindings.
- Click the check box for the Web services client resource.
- Click Detach client policy set.
The application-specific binding configuration you created in
the previous steps is not deleted from the file system when the policy
set is detached. This means that you can still use the application-specific
binding you created to access the STS.
- Configure the STS endpoint URL and the username and password
to authenticate to the STS.
- Click Applications > Application types >
WebSphere enterprise applications > JaxWSServicesSamples >
Service client policy sets and bindings > Saml Bearer Client sample >
WS-Security > Authentication and protection.
- Click gen_saml11token in the
Authentication tokens table.
- Click Callback handler.
- Modify the stsURI property to
specify the STS endpoint. For the self-issuer in an intermediate
server, this property is not required, or if the property is specified,
it is set to www.websphere.ibm.com/SAML/Issuer/Self.
- Verify that the value of the confirmationMethod property
is bearer, or modify the property value if
necessary.
- Verify that the value of the keyType property
is http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer,
or modify the property value if necessary.
- Verify that the value of the wstrustClientPolicy property
is Username WSHTTPS default, or modify the
property if necessary.
- Modify the wstrustClientBinding property
and change the value to match the application-specific binding created
in the previous steps. For this example, the value is SamlTCSample.
- Optional: To change how the application
server searches for the binding, you can specify the wstrustClientBindingScope property
and set its value to either application or domain.
When the value is set to domain, the application server searches
for the wstrustClientBinding at the file system location that contains
general binding documents. When the value is set to application, the
application server searches for the wstrustClientBinding at the file
system location that contains application-specific binding documents.
When the wstrustClientBindingScope property is not specified, the
default behavior of the application server is to search for application-specific
bindings and then search for general bindings. If the wstrustClientBinding
cannot be located, the application server uses the default bindings.
- Optional: You can modify the default trust
client SOAP version, which is the same as the application client.
Set the custom property wstrustClientSoapVersion to
the value 1.1 to change to SOAP Version 1.1, or set
the property to the value 1.2 to change to SOAP Version
1.2.
- Click Apply and Save.
- Optional: If further modifications
to the wstrustClientBinding configuration are needed, and the wstrustClientBinding
property is pointing to an application-specific binding, you must
attach the application-specific binding to the Web services client
before you can complete the modifications. The attachment is temporary.
As detailed in the previous steps, you can detach the modified application-specific
binding from the Web service client after the modification is completed.
- Import the SSL certificate from the
external STS.
- Click Security > SSL certificate and key
management > Manage endpoint security configurations > server_or_node_endpoint >
Keystores and certificates > NodeDefaultTrustStore > Signer certificates.
- Click Retrieve from port.
- Specify the host name and port number of the external
STS server, and assign an alias to the certificate. Use
the SSL STS port.
- Click Retrieve signer information.
- Click Apply and Save to
copy the retrieved certificate to the NodeDefaultTrustStore object.
- Restart the Web services client
application so that the policy set attachment modifications can take
effect.
- Attach the SAML11 Bearer WSHTTPS default policy
set to the Web services provider.
- Assign the Saml Bearer Provider sample general
binding.
- Click WebSphere enterprise applications > JaxWSServicesSamples >
Service client policy sets and bindings > Saml Bearer Provider
sample > WS-Security > Authentication and protection.
- Click con_saml11token in the
Authentication tokens table.
- Click the Callback handler link.
- Use this panel to configure the SAML token issuer digital
signature validation binding data for authentication to the external
STS, as described in the following step.
- Add the external STS signing certificate to the truststore
for the provider. This step is required if the SAML assertions are
signed by the STS and the signatureRequired custom
property is not specified, or has a value of true.
- Set the custom property trustStoreType to
match the key store type. Supported keys store types include: jks, jceks,
and pkcs12.
- Set the custom property trustStorePath to
the key store file location. For example, app_server_root/etc/ws-security/samples/dsig-issuer.jceks.
The file dsig_issuer.jceks is not provided when WebSphere Application Server Version 7.0.0.7
is installed, so you must create the file.
- Set the custom property trustStorePassword to
the value of the truststore password. The password is stored
as a custom property, so the administrative console does not encode
the password. You can use the PropFilePasswordEncoder utility to encode
passwords that are stored in a property file.
The
trustStorePassword, keyStorePassword, and keyPassword custom properties
are automatically encoded when you save the configuration changes
to the master configuration. You can still use the PropFilePasswordEncoder
utility to manually encode passwords that exist in other property
files.
For example:
- Create a property file, myPassword.properties.
The property file contains the following property: myPassword=abcdef.
- Run the following command to encode the password:
PropFilePasswordEncoder myPassword.properties myPassword
The
output of the command is: myPassword={xor}Pj08Ozo5.
- Now you can copy and paste the encoded password as the correct
value of the trustStorePassword custom property.
For more information about the PropFilePasswordEncoder utility,
read about encoding passwords in files.
- Optional: You can set the custom property trustedAlias to
a value such as samlissuer. If this property is specified,
the X.509 certificate represented by the alias is the only STS certificate
that is trusted for SAML signature verification. If this custom property
is not specified, the Web services runtime environment uses the signing
certificate inside the SAML assertions to validate the SAML signature
and then verifies the certificate against the configured truststore.
- Optional: You can set the custom property trustAnySigner to
the value true to allow no signer certificate validation.
The Trust Any certificate configuration setting is ignored for the
purposes of SAML signature validation.
- Optional: You can set the custom property signatureRequired to false,
which waives digital signature validation. However, a good security
practice is to require SAML assertions to be signed and always require
issuer digital signature validation.
- If the SAML assertion is encrypted by the STS with the
PublicKey from the recipient, you must configure the private key from
the recipient to decrypt the EncryptedAssertion. The following callback
handler custom properties must be set to the value described in the
table for the recipient to decrypt the SAML assertion:
Custom property |
Value |
keyStorePath |
Keystore location |
keyStoreType |
Matching keystore type Supported keystore types include:
jks, jceks, and pkcs12
|
keyStorePassword |
Password for the keystore |
keyAlias |
The alias of the public key used for SAML encryption |
keyName |
The name of the public key used for SAML encryption |
keyPassword |
The password for the key name |
- Optional: You can configure the recipient
to validate either the issuer name or the certificate SubjectDN of
the issuer in the SAML assertion, or you can validate both. Create
a list of trusted issuer names, or a list of trusted certificate SubjectDNs,
or both types of lists. If you create both issuer name and SubjectDN
lists, both issuer name and SubjectDN are verified. If the received
SAML issuer name or signer SubjectDN is not in the trusted list, SAML
validation fails, and an exception is issued. This
example shows how to create a list of trusted issuers and trusted
SubjectDNs.
For each trusted issuer name, use trustedIssuer_n where n is
a positive integer. For each trusted SubjectDN, use trustedSubjectDN_n where n is
a positive integer. If you create both types of lists, the integer n must
match in both lists for the same SAML assertion. The integer n starts
with 1, and increments by 1.
In this example, you trust a SAML
assertion with the issuer name
WebSphere/samlissuer,
regardless of the SubjectDN of the signer, so you add the following
custom property:
<properties value="WebSphere/samlissuer" name="trustedIssuer_1"/>
In
addition, you trust a SAML assertion issued by
IBM/samlissuer,
when the SubjectDN of the signer is
ou=websphere,o=ibm,c=us,
so you add the following custom properties:
<properties value="IBM/samlissuer" name="trustedIssuer_2"/>
<properties value="ou=websphere,o=ibm,c=us" name="trustedSubjectDN_2"/>
- Click Apply and Save.
- Add the external STS signing certificate to the truststore
for the client.
- Verify that the value of the confirmationMethod is Bearer.
- Verify that the value of the keyType property
value is http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer.
- Click Apply and Save.
- Optional: You can configure the caller binding
to select a SAML token to represent the requester identity. The
Web services security runtime environment uses the specified JAAS
login configuration to acquire the user security name and group membership
data from the user registry using the SAML token NameId or NameIdentifier
as the user name.
- Click WebSphere enterprise applications > JaxWSServicesSamples >
Service provider policy sets and bindings > Saml Bearer Provider
sample > WS-Security > Callers.
- Click New to create the caller
configuration
- Specify a Name, such as caller.
- Enter a value for the Caller identity local
part. For example, http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1,
which is the local part of the CustomToken element in the attached
WS-Security policy.
- Click Apply and Save.
- Restart the Web services provider application so that the
policy set attachment modifications can take effect.
Results
When you have completed the procedure, the JaxWSServicesSamples
Web services application is ready to use the SAML Bearer default policy
set, the Saml Bearer Client sample, and the Saml Bearer Provider sample
general bindings.