use of org.apache.kerby.kerberos.kerb.gss.KerbyGssProvider in project testcases by coheigea.
the class JWTJAXRSAuthenticationTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
Provider provider = new KerbyGssProvider();
java.security.Security.insertProviderAt(provider, 1);
WSSConfig.init();
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
kerbyServer = new SimpleKdcServer();
kerbyServer.setKdcRealm("service.ws.apache.org");
kerbyServer.setAllowUdp(true);
kerbyServer.setWorkDir(new File(basedir + "/target"));
kerbyServer.setInnerKdcImpl(new NettyKdcServerImpl(kerbyServer.getKdcSetting()));
kerbyServer.getKdcConfig().setString(KdcConfigKey.TOKEN_ISSUERS, "DoubleItSTSIssuer");
kerbyServer.getKdcConfig().setString(KdcConfigKey.TOKEN_VERIFY_KEYS, "mysts.cer");
kerbyServer.init();
// Create principals
String alice = "alice@service.ws.apache.org";
String dave = "dave@service.ws.apache.org";
String bob = "bob/service.ws.apache.org@service.ws.apache.org";
kerbyServer.createPrincipal(alice, "alice");
kerbyServer.createPrincipal(dave, "dave");
kerbyServer.createPrincipal(bob, "bob");
kerbyServer.start();
// System.setProperty("sun.security.krb5.debug", "true");
System.setProperty("java.security.auth.login.config", basedir + "/target/test-classes/kerberos/kerberos.jaas");
System.setProperty("java.security.krb5.conf", basedir + "/target/krb5.conf");
Assert.assertTrue("Server failed to launch", // set this to false to fork
AbstractBusClientServerTestBase.launchServer(Server.class, true));
Assert.assertTrue("Server failed to launch", // set this to false to fork
AbstractBusClientServerTestBase.launchServer(STSRESTServer.class, true));
}
Aggregations