Search in sources :

Example 6 with MapRealm

use of org.apache.catalina.startup.TestTomcat.MapRealm in project tomcat70 by apache.

the class TesterDigestAuthenticatorPerformance method setUp.

@Before
public void setUp() throws Exception {
    ConcurrentMessageDigest.init("MD5");
    // Configure the Realm
    MapRealm realm = new MapRealm();
    realm.addUser(USER, PWD);
    realm.addUserRole(USER, ROLE);
    // Add the Realm to the Context
    Context context = new StandardContext();
    context.setName(CONTEXT_PATH);
    context.setRealm(realm);
    // Make the Context and Realm visible to the Authenticator
    authenticator.setContainer(context);
    authenticator.setNonceCountWindowSize(8 * 1024);
    authenticator.start();
}
Also used : Context(org.apache.catalina.Context) StandardContext(org.apache.catalina.core.StandardContext) StandardContext(org.apache.catalina.core.StandardContext) MapRealm(org.apache.catalina.startup.TestTomcat.MapRealm) Before(org.junit.Before)

Aggregations

Context (org.apache.catalina.Context)6 MapRealm (org.apache.catalina.startup.TestTomcat.MapRealm)6 LoginConfig (org.apache.catalina.deploy.LoginConfig)5 Tomcat (org.apache.catalina.startup.Tomcat)4 BasicAuthenticator (org.apache.catalina.authenticator.BasicAuthenticator)3 ByteChunk (org.apache.tomcat.util.buf.ByteChunk)3 ServletContext (javax.servlet.ServletContext)2 SecurityCollection (org.apache.catalina.deploy.SecurityCollection)2 SecurityConstraint (org.apache.catalina.deploy.SecurityConstraint)2 TomcatBaseTest (org.apache.catalina.startup.TomcatBaseTest)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 UnknownHostException (java.net.UnknownHostException)1 KeyManagementException (java.security.KeyManagementException)1 KeyStore (java.security.KeyStore)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 X509Certificate (java.security.cert.X509Certificate)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1