[Fix Pack 7 or later]

Configuring client and provider bindings for the SAML bearer token

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

  1. 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
    1. Click Services > Policy sets > Application policy sets.
    2. Click Import.
    3. Select From Default Repository.
    4. Select the two default policy sets.
    5. Click OK to import the policy sets.
  2. 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.
    1. Select the check box for the Web services client resource.
    2. Click Attach Client Policy Set.
    3. 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.
  3. Configure the trust client binding.
    1. Select the Web services client resource again.
    2. In the Service client policy sets and bindings panel, click Assign Binding.
    3. Click New Application Specific Binding to create an application-specific binding.
    4. Specify a binding configuration name for the new application-specific binding. In this example, the binding name is SamlTCSample.
    5. 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.
  4. Add the WS-Security policy type to the binding, then modify the authentication settings.
    1. Click Applications > Application types > WebSphere enterprise applications > JaxWSServicesSamples > Service client policy sets and bindings > SamlTCSample > Add > WS-Security > Authentication and protection > request:uname_token.
    2. Click Apply.
    3. Select Callback handler.
    4. Specify a user name and password (and confirm the password) to authenticate the Web services client to the external STS.
    5. Click OK and Save.
  5. After the binding settings are saved, return to the Service client policy sets and bindings panel to detach the policy set and bindings.
    1. Click Applications > Application types > WebSphere enterprise applications > JaxWSServicesSamples > Service client policy sets and bindings.
    2. Click the check box for the Web services client resource.
    3. 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.
  6. Configure the STS endpoint URL and the username and password to authenticate to the STS.
    1. Click Applications > Application types > WebSphere enterprise applications > JaxWSServicesSamples > Service client policy sets and bindings > Saml Bearer Client sample > WS-Security > Authentication and protection.
    2. Click gen_saml11token in the Authentication tokens table.
    3. Click Callback handler.
    4. 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.
    5. Verify that the value of the confirmationMethod property is bearer, or modify the property value if necessary.
    6. 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.
    7. Verify that the value of the wstrustClientPolicy property is Username WSHTTPS default, or modify the property if necessary.
    8. 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.
    9. 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.
    10. 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.
    11. Click Apply and Save.
  7. 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.
  8. Import the SSL certificate from the external STS.
    1. Click Security > SSL certificate and key management > Manage endpoint security configurations > server_or_node_endpoint > Keystores and certificates > NodeDefaultTrustStore > Signer certificates.
    2. Click Retrieve from port.
    3. Specify the host name and port number of the external STS server, and assign an alias to the certificate. Use the SSL STS port.
    4. Click Retrieve signer information.
    5. Click Apply and Save to copy the retrieved certificate to the NodeDefaultTrustStore object.
  9. Restart the Web services client application so that the policy set attachment modifications can take effect.
  10. Attach the SAML11 Bearer WSHTTPS default policy set to the Web services provider.
  11. Assign the Saml Bearer Provider sample general binding.
  12. Click WebSphere enterprise applications > JaxWSServicesSamples > Service client policy sets and bindings > Saml Bearer Provider sample > WS-Security > Authentication and protection.
    1. Click con_saml11token in the Authentication tokens table.
    2. Click the Callback handler link.
    3. 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.
  13. 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.
    1. Set the custom property trustStoreType to match the key store type. Supported keys store types include: jks, jceks, and pkcs12.
    2. 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.
    3. 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.

      [Fix Pack 9 or later] 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:
      1. Create a property file, myPassword.properties. The property file contains the following property: myPassword=abcdef.
      2. Run the following command to encode the password:
        PropFilePasswordEncoder myPassword.properties myPassword
        The output of the command is: myPassword={xor}Pj08Ozo5.
      3. 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.
    4. 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.
    5. 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.
    6. 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.
    7. 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
    8. 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"/> 
    9. Click Apply and Save.
  14. Add the external STS signing certificate to the truststore for the client.
    1. Verify that the value of the confirmationMethod is Bearer.
    2. Verify that the value of the keyType property value is http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer.
    3. Click Apply and Save.
  15. 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.
    1. Click WebSphere enterprise applications > JaxWSServicesSamples > Service provider policy sets and bindings > Saml Bearer Provider sample > WS-Security > Callers.
    2. Click New to create the caller configuration
    3. Specify a Name, such as caller.
    4. 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.
    5. Click Apply and Save.
  16. 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.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 22, 2010 12:21:29 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-zos&topic=configsamlbearertoken
File name: twbs_configsamlbearertoken.html