Configuring Security for WebLogic SIP Server

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Configuring Digest Authentication

The following sections describe how to configure WebLogic SIP Server to use Digest authentication with a supported LDAP server or RDBMS:

 


Overview of Digest Authentication

The following sections provide a basic overview of Digest authentication, and describe Digest authentication support and configuration in WebLogic SIP Server.

What Is Digest Authentication?

Digest authentication is a simple challenge-response mechanism used to authenticate a user over SIP or HTTP. Digest authentication is fully described in RFC 2617.

When using Digest authentication, if a client makes an un-authenticated request for a protected server resource, the server challenges the client using a nonce value. The client uses a requested algorithm (MD5 by default) to generate an encrypted response—a Digest—that includes a username, password, the nonce value from the challenge, the SIP method, and the requested URI.

The server verifies the client Digest by recreating the Digest value and comparing it with the client's Digest. To recreate the Digest value the server requires a hash of the "A1" value (see RFC 2617) that includes, at minimum, the nonce, username, password and realm name. The server either recreates the hash of the A1 value using a stored clear-text password for the user, or by obtaining a precalculated hash value. Either the clear-text password or precalculated hash value can be stored in an LDAP directory or accessed from an RDBMS using JDBC. The server then uses the hash of the A1 value to recreate the Digest and compare it to the client's Digest to verify the user's identity.

Digest authentication provides secure authorization over HTTP because the clear text password is never transmitted between the client and server. The use of nonce values in the client challenge also ensures that Digest authentication is resistant to replay attacks. See Figure 2-1 for a more detailed explanation of the challenge-response mechanism for a typical request.

Digest Authentication Support in WebLogic SIP Server

WebLogic SIP Server includes LDAP Digest Identity Asserter security providers for asserting the validity of a client's Digest using LDAP or an RDBMS. A separate authorization provider is required to complete the authentication process (see Configure an Authenticator Provider).

The Digest Identity Asserter only verifies a user's credentials using the client Digest. After the Digest is verified, the configured authorization provider completes the authentication process by checking for the existence of the user (by username) and also populating group membership for the resulting javax.security.auth.Subject.

The Digest Identity Asserter provider requires that user credentials be stored in an LDAP server or RDBMS in one of the following ways:

The LDAP Digest Identity Asserter is compatible with any LDAP provider that permits storage of a clear text password or pre-calculated hash value.

Notes: You cannot change the schema for the built-in LDAP store to add a dedicated field for storing clear text passwords or pre-calculated hash values. However, you can use the predefined "description" field to store password information for testing or demonstration purposes.
Note: If you do not use the DefaultAuthenticator provider for authentication decisions, you must make DefaultAuthenticator an optional provider (ControlFlag="SUFFICIENT" or lower) before you can use Digest authentication. This will generally be the required configuration in production installations where a separate LDAP store is used to maintain clear text or hashed password information.
Figure 2-1 Digest Authentication in WebLogic SIP Server

Digest Authentication in WebLogic SIP Server

Figure 2-1 shows the basic architecture and use of an Identity Asserter provider for a typical client request:

  1. The client makes an unauthorized request for a protected application resource. (SIP Servlet resources can be protected by specifying security constraints in the sip-xml deployment descriptor. See Controlling Access to SIP Servlet Resources.)
  2. The Digest Identity Asserter provider generates a challenge string consisting of the nonce value, realm name, and encryption algorithm (either MD5 or MD5-sess). The SIP container delivers the challenge string to the client.
  3. Note: The Digest Identity Asserter maintains a cache of used nonces and timestamps for a specified period of time. All requests with a timestamp older than the specified timestamp are rejected, as well as any requests that use the same timestamp/nonce pair as the most recent timestamp/nonce pair still in the cache.
  4. The client uses the encryption algorithm to create a Digest consisting of the username, password, real name, nonce, SIP method, request URI, and other information described in RFC 2617.
  5. The Digest Identity Asserter verifies the client Digest by recreating the Digest value using a hash of the A1 value, nonce, SIP method, and other information. To obtain a hash of the A1 value, the Identity Asserter either generates HA1 by retrieving a clear-text password from the store, or the Identity Asserter retrieves the pre-calculated HA1 from the store.
  6. The generated Digest string is compared to the client's Digest to verify the user's identity.
  7. If the user's identity is verified, an authentication provider then determines if the user exists and if it does, the authentication provider populates the javax.security.auth.Subject with the configured group information. This step completes the authentication process.
  8. Note: If you do not require user existence checking or group population, you can use the special "no-op" Identity Assertion Authenticator to avoid an extra connection to the LDAP Server; see Configure an Authenticator Provider for more information.

    After authentication is complete, the SIP Servlet container performs an authorization check for the logged in javax.security.auth.Subject against the declarative security-constraints defined in the Servlet's sip.xml deployment descriptor.

The LDAP Digest Identity Asserter and the configured Authentication provider can either use the same LDAP store or different stores.

Note: If you use multiple LDAP stores, you must also create some infrastructure to keep both stores synchronized in response to adding, removing, or changing user credential changes, as shown in Figure 2-2. Maintaining LDAP stores in this manner is beyond the scope of this documentation.
Figure 2-2 Multiple LDAP Servers

Multiple LDAP Servers

 


Prerequisites for Configuring LDAP Digest Authentication

In order to configure Digest authentication you must understand the basics of LDAP servers and LDAP administration. You must also understand the requirements and restrictions of your selected LDAP server implementation, and have privileges to modify the LDAP configuration as well as the WebLogic SIP Server configuration.

Table 2-1 summarizes all of the information you will need in order to fully configure your LDAP server for Digest authentication with WebLogic SIP Server.

Note that the LDAP authentication provider and the Digest Authentication Identity Asserter provider can be configured with multiple LDAP servers to provide failover capabilities. If you want to use more than one LDAP server for failover, you will need to have connection information for each server when you configure Digest Authentication. See Steps for Configuring Digest Authentication.

Table 2-1 Digest Identity Asserter Checklist
Item
Description
Sample Value
Host
The host name of the LDAP server.
MyLDAPServer
Port
The port number of the LDAP server. Port 389 is used by default.
389
Principal
A Distinguished Name (DN) that WebLogic SIP Server can use to connect to the LDAP Server.
cn=ldapadminuser
Credential
A credential for the above principal name (generally a password).
ldapadminuserpassword
LDAP Connection Timeout
The configured timeout value for connections to the LDAP server (in seconds). For best performance, there should be no timeout value configured for the LDAP server. If a timeout value is specified for the LDAP server, you should configure the Digest Identity Asserter provider timeout to a value equal to or less than the LDAP server's timeout.
30 seconds
User From Name Filter
An LDAP search filter that WebLogic SIP Server will use to locate a given username. If you do not specify a value for this attribute, the server uses a default search filter based on the user schema.
(&(cn=%u)(objectclass=person))
User Base DN
The base Distinguished Name (DN) of the tree in the LDAP directory that contains users.
cn=users,dc=mycompany,dc=com
Credential Attribute Name
The credential attribute name used for Digest calculation. This corresponds to the attribute name used to store unencrypted passwords or pre-calculated hash values. See Configure the LDAP Server or RDBMS.
hashvalue
Digest Realm Name
The realm name to use for Digest authentication.
mycompany.com
Digest Algorithm
The algorithm that clients will use to create encrypted Digests. WebLogic SIP Server supports both MD5 and MD5-sess algorithms. MD5 is used by default.
MD5
Digest Timeout
The Digest authentication timeout setting. By default this value is set to 120 seconds.
120

 


Steps for Configuring Digest Authentication

Follow these steps to configure Digest authentication with WebLogic SIP Server:

  1. Configure the LDAP Server or RDBMS.
  2. Reconfigure the DefaultAuthenticator Provider.
  3. Note: DefaultAuthenticator is set up as a required authentication provider by default. If the DefaultAuthentication provider, which works against the embedded LDAP store, is not used for authentication decisions, you must change the Control Flag to "SUFFICIENT".
  4. Configure an Authenticator Provider.
  5. Configure a New Digest Identity Asserter Provider.

The sections that follow describe each step in detail.

Configure the LDAP Server or RDBMS

The LDAP server or RDBMS used for Digest verification must store either unencrypted, clear text passwords, pre-calculated hash values, or passwords encrypted by a standard encryption algorithm (3DES_EDE/CBC/PKCS5Padding by default). The sections below provide general information about setting up your LDAP server or RDBMS to store the required information. Keep in mind that LDAP server uses different schemas and different administration tools, and you may need to refer to your LDAP server documentation for information about how to perform the steps below.

If you are using multiple LDAP servers to enable failover capabilities for the security providers, you must configure each LDAP server as described below.

Using Unencrypted Passwords

If you are using an RDBMS, or if your LDAP server's schema allows storing unencrypted passwords in the user's password attribute, no additional configuration is needed. The Digest Identity Asserter provider looks for unencrypted passwords in the password field by default.

If the schema does not allow unencrypted passwords in the password attribute, you have two options:

See your LDAP server documentation for more information about credential attributes available in the schema. Regardless of which method you use, record the exact attribute name used to store unencrypted passwords. You must enter the name of this attribute when configuring the LDAP Digest Identity Asserter provider.

Using Precalculated Hash Values

If you want to use precalculated hash values, rather than unencrypted passwords, you can store the hash values in one of two places in your LDAP directory:

See your LDAP server documentation for more information using or creating new credential attributes.

For RDBMS stores, you can place the hash values in any column in your schema; you will define the SQL command used to obtain the hash values when configuring the RDBMS Identity Assertion Provider.

WebLogic SIP Server provides a simple utility to generate a hash of the A1 value from a given username, realm name, and unencrypted password. The utility is packaged as com.bea.wcp.sip.security.utils.PreCalculatedHash. Use the syntax:

java com.bea.wcp.sip.security.utils.PreCalculatedHash user_name realm_name password

You can use also use 3rd-party utilities for generating the hash value, or create your own method using information from RFC 2617.

Note that you must also create the necessary infrastructure to update the stored hash value automatically when the user name, password, or realm name values change. Maintaining the password information in this manner is beyond the scope of this documentation.

Using Reverse-Encrypted Passwords

WebLogic SIP Server provides a utility to help you compute the Encryption Key, Encryption Init Vector, and Encrypted Passwords values used when you configure the Digest Authorization Identity Asserter provider. The utility is named com.bea.wcp.sip.security.utils.JSafeEncryptionUtil and is packaged in the wlss.jar file in the WLSS_HOME/telco/lib directory.

To view usage instructions and syntax:

  1. Add wlss.jar to your classpath:
  2. export CLASSPATH=$CLASSPATH:~/bea/sipserver31/server/lib/wlss/wlss.jar
  3. Execute the utility without specifying options:
  4. java com.bea.wcp.sip.security.utils.JSafeEncryptionUtil

Reconfigure the DefaultAuthenticator Provider

In most production environments you will use a separate LDAP provider for storing password information, and therefore the DefaultAuthenticator, which works against the embedded LDAP store, must not be required for authentication. Follow the instructions in this section to change the provider's control flag to "sufficient".

Note: DefaultAuthenticator is set up as a required authentication provider by default. If the DefaultAuthentication provider, which works against the embedded LDAP store, is not used for authentication decisions, you must change the Control Flag to "SUFFICIENT".

To reconfigure the DefaultAuthenticator provider:

  1. Log in to the Administration Console for the WebLogic SIP Server domain you want to configure.
  2. Click Lock & Edit to obtain a configuration lock.
  3. In the left pane of the Console, select the Security Realms node.
  4. Select the name of your security realm in the right pane of the Console. (for example, "myrealm").
  5. Select the Providers->Authentication tab.
  6. Select the DefaultAuthenticator provider.
  7. In the Configuration->Common tab, change the Control Flag value to SUFFICIENT.
  8. Click Save to save your changes.
  9. Click Activate Changes to apply the configuration.

Configure an Authenticator Provider

In addition to the Digest Identity Asserter providers, which only validate the client digest, you must configure an "authentication" provider, which checks for a user's existence and populates the user's group information. Follow the instructions in Configuring LDAP Authentication Providers in the WebLogic Server 9.2 documentation set to create an LDAP authentication provider for your LDAP server. Use the information from Table 2-1, Digest Identity Asserter Checklist, on page 2-6 to configure the provider.

If you do not require user existence checking or group population, then, in addition to a Digest Identity Asserter provider, you can configure and use the special "no-op" authentication provider, packaged by the name "IdentityAssertionAuthenticator." This provider is helpful to avoid an extra round-trip connection to the LDAP server. Note that the provider performs no user validation and should be used when group information is not required for users.

To configure the "no-op" authorization provider:

  1. Log in to the Administration Console for the WebLogic SIP Server domain you want to configure.
  2. Click Lock & Edit to obtain a configuration lock.
  3. In the left pane of the Console, select the Security Realms node.
  4. Select the name of your security realm in the right pane of the Console. (for example, "myrealm").
  5. Select the Providers->Authentication tab.
  6. Click New.
  7. Enter a name for the new provider, and select "IdentityAssertionAuthenticator" as the type.
  8. Click OK.
  9. Select the name of the new provider from the list of providers.
  10. Set the Control Flag to SUFFICIENT in the Configuration->Common tab.
  11. Click Save to save your changes.
  12. Click Activate Changes to apply the configuration.

Configure a New Digest Identity Asserter Provider

Follow these instructions in one of the sections below to create the Digest Identity Asserter provider and associate it with your LDAP server or RDBMS store:

Configure an LDAP Digest Identity Asserter Provider

Follow these instructions to create a new LDAP Digest Identity Asserter Provider:

  1. Log in to the Administration Console for the WebLogic SIP Server domain you want to configure.
  2. Click Lock & Edit to obtain a configuration lock.
  3. In the left pane of the Console, select the Security Realms node.
  4. Select the name of your security realm in the right pane of the Console. (for example, "myrealm").
  5. Select the Providers->Authentication tab.
  6. Click New.
  7. Enter a name for the new provider, and select "LDAP Digest Identity Asserter" as the type.
  8. Click OK.
  9. Select the name of the new provider from the list of providers.
  10. Select the Configuration->Provider Specific tab in the right pane.
  11. On the configuration page, enter LDAP server and Digest authentication information into the fields as follows (use the information from Table 2-1):
    • User From Name Filter: Enter an LDAP search filter that WebLogic SIP Server will use to locate a given username. If you do not specify a value for this attribute, the server uses a default search filter based on the user schema.
    • User Base DN: Enter the base Distinguished Name (DN) of the tree in the LDAP directory that contains users.
    • Credential Attribute Name: Enter the credential attribute in the LDAP directory that stores either the pre-calculated hash value or the unencrypted password. By default WebLogic SIP Server uses the password attribute of the user entry. If you use a pre-calculated has value instead of an unencrypted password, or if the unencrypted password is stored in a different attribute, you must specify the correct attribute name here.
    • Group Attribute Name: Enter the group attribute in the LDAP directory that stores a the set of group names to which the user belongs.
    • Password Encryption Type: Select the format in which the password is stored: PLAINTEXT, PRECALCULATEDHASH, or REVERSIBLEENCRYPTED.
    • Encryption Algorithm: If you have stored encrypted passwords, enter the encryption algorithm that the Digest identity assertion provider will use for reverse encryption.
    • Encryption Key and Please type again to confirm: If you have stored encrypted passwords, enter the base-64 encrypted key used as part of the reverse encryption algorithm.
    • Encryption Init Vector and Please type again to confirm: If you have stored encrypted passwords, enter the base-64 encrypted init vector string used as part of the reverse encryption algorithm.
    • Digest Realm Name: Enter the realm name to use for Digest authentication.
    • Digest Algorithm: Select either MD5 or MD5-sess as the algorithm to use for encrypting Digests.
    • Digest Timeout: This value defines the nonce timeout value for the digest challenge. If the nonce timeout is reached before the client responds, the client is re-challenged with a new nonce. By default, the Digest Timeout is set to 120 seconds.
    • Host: Enter the host name of the LDAP server to use for Digest verification. If you are using multiple LDAP servers for failover capabilities, enter the hostname:port value for each server separated by spaces. For example: ldap1.mycompany.com:1050 ldap2.mycompany.com:1050
    • See Configuring Failover for LDAP Authentication Providers in the WebLogic Server 9.2 documentation for more information about configuring failover.

    • Port: Enter the port number of the LDAP server.
    • SSL Enabled: Select this option if you are using SSL to communicate unencrypted passwords between WebLogic SIP Server and the LDAP Server.
    • Principal: Enter the name of a principal that WebLogic SIP Server uses to access the LDAP server.
    • Credential and Please type again to confirm: Enter the credential for the above principal name (generally a password).
  12. Click Save to save your changes.
  13. Select the Performance tab in the right pane.
  14. On the Performance page, enter the caching and connection information into the fields as follows:
    • LDAP Connection Pool Size: Enter the number of connections to use for connecting to the LDAP Server. This value should be equal to or less than the total number of execute threads configured for WebLogic SIP Server. To view the current number of configured threads, right-click on the WebLogic SIP Server name in the left pane of the Administration Console and select View Execute Queues; the SIP Container uses the Thread Count value of the queue named sip.transport.Default. The default value of LDAP Connection Pool Size is 10.
    • Note that stale connections (for example, LDAP connections that are timed out by a load balancer) are automatically removed from the connection pool.

    • Cache Enabled: Specifies whether a cache should be used with the associated LDAP server.
    • Cache Size: Specifies the size of the cache, in Kilobytes, used to store results from the LDAP server. By default the cache size is 32K.
    • Cache TTL: Specifies the time-to-live (TTL) value, in seconds, for the LDAP cache. By default the TTL value is 60 seconds.
    • Results Time Limit: Specifies the number of milliseconds to wait for LDAP results before timing out. Accept the default value of 0 to specify no time limit.
    • Connect Timeout: Specifies the number of milliseconds to wait for an LDAP connection to be established. If the time is exceeded, the connection times out. The default value of 0 specifies no timeout value.
    • Parallel Connect Delay: Specifies the number of seconds to delay before making concurrent connections to multiple, configured LDAP servers. If this value is set to 0, the provider connects to multiple servers in a serial fashion. The provider first tries to connect to the first configured LDAP server in the Host list. If that connection attempt fails, the provider tries the next configured server, and so on.
    • If this value is set to a non-zero value, the provider waits the specified number of seconds before spawning a new thread for an additional connection attempt. For example, if the value is set to 2, the provider first tries to connect to the first configured LDAP server in the Host list. After 2 seconds, if the connection has not yet been established, the provider spawns a new thread and tries to connect to the second server configured in the Host list, and so on for each configured LDAP server.

    • Connection Retry Limit: Specifies the number of times the provider tries to reestablish a connection to an LDAP server if the LDAP server throws an exception while creating a connection.
  15. Click Save to save your changes.
  16. Click Activate Changes to apply the configuration.

Configure an RDBMS Digest Identity Asserter Provider

Follow these instructions to create a new RDBMS Digest Identity Asserter Provider:

  1. Log in to the Administration Console for the WebLogic SIP Server domain you want to configure.
  2. Click Lock & Edit to obtain a configuration lock.
  3. In the left pane of the Console, select the Security Realms node.
  4. Select the name of your security realm in the right pane of the Console. (for example, "myrealm").
  5. Select the Providers->Authentication tab.
  6. Click New.
  7. Enter a name for the new provider, and select "DBMSDigestIdentityAsserter" as the type.
  8. Click OK.
  9. Select the name of the new provider from the list of providers.
  10. Select the Configuration->Provider Specific tab in the right pane.
  11. In the configuration tab, enter RDBMS server and Digest authentication information into the fields as follows:
    • Data Source Name: Enter the name of the JDBC DataSource used to access the password information.
    • SQLGet Users Password: Enter the SQL statement used to obtain the password or hash value from the database. The SQL statement must return a single record result set.
    • SQLList Member Groups: Enter a SQL statement to obtain the group information from a specified username. The username is supplied as a variable to the SQL statement, as in SELECT G_NAME FROM groupmembers WHERE G_MEMBER = ?.
    • Password Encryption Type: Select the format in which the password is stored: PLAINTEXT, PRECALCULATEDHASH, or REVERSIBLEENCRYPTED.
    • Encryption Algorithm: If you have stored encrypted passwords, enter the encryption algorithm that the Digest identity assertion provider will use for reverse encryption.
    • Encryption Key and Please type again to confirm: If you have stored encrypted passwords, enter the base-64 encrypted key used as part of the reverse encryption algorithm.
    • Encryption Init Vector and Please type again to confirm: If you have stored encrypted passwords, enter the base-64 encrypted init vector string used as part of the reverse encryption algorithm.
    • Digest Realm Name: Enter the realm name to use for Digest authentication.
    • Digest Algorithm: Select either MD5 or MD5-sess as the algorithm to use for encrypting Digests.
    • Digest Timeout: This value defines the nonce timeout value for the digest challenge. If the nonce timeout is reached before the client responds, the client is re-challenged with a new nonce. By default, the Digest Timeout is set to 120 seconds.
  12. Click Save to save your changes.
  13. Click Activate Changes to apply the configuration.

 


Sample Digest Authentication Configuration Using Embedded LDAP

You can use WebLogic SIP Server's embedded LDAP implementation for Digest authentication in a test or demo environment. Because you cannot change the schema of the embedded LDAP store, you must store password information in the existing "description" field.

To use the embedded LDAP store for Digest authentication, follow the instructions in the sections that follow.

Store User Password Information in the Description Field

To create new users with password information in the existing "description" field:

  1. Log in to the Administration Console for the WebLogic SIP Server domain you want to configure.
  2. Click Lock & Edit to obtain a configuration lock.
  3. In the left pane of the Console, select the Security Realms node.
  4. Select the name of your security realm in the right pane of the Console. (for example, "myrealm").
  5. Select the Users and Groups->Users tab.
  6. Click New.
  7. Enter a name for the new user in the Name field.
  8. Enter the Digest password information for the user in the Description field. The password information can be either the clear-text password, a pre-calculated hash value, or a reverse-encrypted password.
  9. Enter an 8-character password in the Password and Confirm Password fields. You cannot proceed without adding a standard password entry.
  10. Click OK.
  11. Click Activate Changes to apply the configuration.

Set the Embedded LDAP Password

Follow these instructions to set the password for the embedded LDAP store to a known password. You will use this password when configuring the Digest Identity Asserter provider as described in Configure an LDAP Digest Identity Asserter Provider:

  1. Log in to the Administration Console for the WebLogic SIP Server domain you want to configure.
  2. Click Lock & Edit to obtain a configuration lock.
  3. In the left pane, click the name of the domain you are configuring (for example, mydomain).
  4. Select Security > Embedded LDAP in the right pane.
  5. Enter the password you would like to use in the Credential and Confirm Credential fields.
  6. Click Save.
  7. Click Activate Changes to apply the configuration.
  8. Reboot the server.

Configure the Digest Identity Asserter Provider

Listing 2-1 shows the security provider configuration in config.xml for a domain that uses LDAP implementation embedded in WebLogic SIP Server. Note that such a configuration is recommended only for testing or development purposes. Listing 2-1 highlights values that you must define when configuring the provider using the instructions in Configure an LDAP Digest Identity Asserter Provider.

Listing 2-1 Sample Security Provider Configuration with Embedded LDAP
<sec:authentication-provider xmlns:ext="http://www.bea.com/ns/weblogic/90/security/extension" xsi:type="ext:ldap-digest-identity-asserterType">
        <sec:name>myrealmLdapDigestIdentityAsserter</sec:name>
        <ext:user-base-dn>ou=people, ou=myrealm, dc=mydomain</ext:user-base-dn>
        <ext:credential-attribute-name>description</ext:credential-attribute-name>
        <ext:digest-realm-name>wlss.bea.com</ext:digest-realm-name>
        <ext:host>myserver.mycompany.com</ext:host>
        <ext:port>7001</ext:port>
        <ext:principal>cn=Admin</ext:principal>
      </sec:authentication-provider>

  Back to Top       Previous  Next