org.eclipse.jetty.webapp.WebAppContext.setSecurityHandler()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.setSecurityHandler()方法的一些代码示例,展示了WebAppContext.setSecurityHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.setSecurityHandler()方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:setSecurityHandler

WebAppContext.setSecurityHandler介绍

暂无

代码示例

代码示例来源:origin: works.lmz.common/common-runnable-war

context.setSecurityHandler(new RemoteUserSecurityHandler());

代码示例来源:origin: fbacchella/jrds

sh.setConstraintMappings(Collections.singletonList(cm));
sh.setAuthenticator(auth);
webapp.setSecurityHandler(sh);

代码示例来源:origin: org.apache.brooklyn/brooklyn-launcher

/** not much fun without a REST server. 
 * but TODO we should make it so a different REST endpoint could be configured. 
 * or better, use node js launchers in that project (likely to come with a new ui.) 
 * <p>
 * relative path to webapp assumes brooklyn-server has been checked out at the same level as brooklyn-ui;
 * see {@link BrooklynRestApiLauncher#findJsguiWebappInSource()} */
public static Server startJavascriptWithoutRest() throws Exception {
  WebAppContext context = new WebAppContext(
    BrooklynRestApiLauncher.findJsguiWebappInSource().isPresent() 
      ? BrooklynRestApiLauncher.findJsguiWebappInSource().get()
    : ResourceUtils.create(BrooklynJavascriptGuiLauncher.class).doesUrlExist("classpath://brooklyn.war") 
      ? Os.writeToTempFile(ResourceUtils.create(BrooklynJavascriptGuiLauncher.class).getResourceFromUrl("classpath://brooklyn.war"), "brooklyn", "war").getAbsolutePath()
    : throwingReturning("could not find jsgui war or source", "missing-brooklyn.war"),
    "/");
  context.setSecurityHandler(new NopSecurityHandler());
  Server server = new Server(new InetSocketAddress(Networking.LOOPBACK, Networking.nextAvailablePort(FAVOURITE_PORT)));
  BrooklynRestApiLauncher.initJaasLoginService(server);
  server.setHandler(context);
  server.start();
  log.info("JS GUI server started (no REST) at  http://localhost:"+((NetworkConnector)server.getConnectors()[0]).getLocalPort()+"/");
  
  return server;
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

context.setSecurityHandler(securityHandler.get());

代码示例来源:origin: org.keycloak/keycloak-spring-boot-adapter-core

securityHandler.setAuthenticator(keycloakJettyAuthenticator);
webAppContext.setSecurityHandler(securityHandler);

代码示例来源:origin: org.apache.brooklyn/brooklyn-rest-server

((WebAppContext)context).setSecurityHandler(new NopSecurityHandler());

相关文章

微信公众号

最新文章

更多

WebAppContext类方法