From: markt java.security.MessageDigest class on your platform.
diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 2e07d47bc..95a0a29b9 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -165,9 +165,7 @@ public class BasicAuthenticator
StringBuilder value = new StringBuilder(16);
value.append("Basic realm=\"");
if (config.getRealmName() == null) {
- value.append(request.getServerName());
- value.append(':');
- value.append(Integer.toString(request.getServerPort()));
+ value.append(REALM_NAME);
} else {
value.append(config.getRealmName());
}
diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index c246bb195..399eef0ed 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -408,8 +408,7 @@ public class DigestAuthenticator
// Get the realm name
String realmName = config.getRealmName();
if (realmName == null)
- realmName = request.getServerName() + ":"
- + request.getServerPort();
+ realmName = REALM_NAME;
byte[] buffer = null;
synchronized (md5Helper) {
diff --git a/webapps/docs/realm-howto.xml b/webapps/docs/realm-howto.xml
index 5d2d31bf1..bb4170349 100644
--- a/webapps/docs/realm-howto.xml
+++ b/webapps/docs/realm-howto.xml
@@ -209,7 +209,11 @@ java org.apache.catalina.realm.RealmBase \
{cleartext-password} must be replaced with
{username}:{realm}:{cleartext-password}. For example, in a
development environment this might take the form
- testUser:localhost:8080:testPassword.
testUser:Authentication required:testPassword. The value for
+ {realm} is taken from the <realm-name>
+ element of the web application's <login-config>. If
+ not specified in web.xml, the default value of Authentication
+ required is used.
To use either of the above techniques, the
$CATALINA_HOME/lib/catalina.jar and