d.addSecurityConstraint(securityConstraint);
private DeploymentInfo deploymentInfo() throws InterruptedException { final ResteasyDeployment resteasyDeployment = new ResteasyDeployment(); Utils.waitForCDIProvider(context); resteasyDeployment.setResourceFactories(resourceFactories()); final DeploymentInfo deploymentInfo = this.server.undertowDeployment(resteasyDeployment, String.valueOf(this.context.getProperties().get(HTTP_SERVER_REST_SERVLET_MAPPING_PREFIX))) .setContextPath(String.valueOf(this.context.getProperties().get(HTTP_SERVER_REST_CONTEXT_PATH))) .setClassLoader(this.getClass().getClassLoader()) .setDeploymentName("Silverware rest deployment"); if (this.sslEnabled) { deploymentInfo .addSecurityConstraint(new SecurityConstraint().addWebResourceCollection(new WebResourceCollection() .addUrlPattern("/*")) .setTransportGuaranteeType(TransportGuaranteeType.CONFIDENTIAL) .setEmptyRoleSemantic(SecurityInfo.EmptyRoleSemantic.PERMIT)) .setConfidentialPortManager(exchange -> sslPort()); } return deploymentInfo; }
private void configureDeploymentSecurity(DeploymentInfo deploymentInfo) { deploymentInfo.setIdentityManager(identityManager); deploymentInfo.setLoginConfig(new LoginConfig(HttpServletRequest.BASIC_AUTH, "lightblueRealm")); deploymentInfo.addSecurityConstraint(new SecurityConstraint() .addWebResourceCollection(new WebResourceCollection().addUrlPattern("/*")) .addRoleAllowed(SECURITY_ROLE_AUTHENTICATED)); deploymentInfo.addSecurityRole(SECURITY_ROLE_AUTHENTICATED); }
uiCollection.addHttpMethods( UIServlet.METHODS ); ui.addWebResourceCollection( uiCollection ); di.addSecurityConstraint( ui ); di.addSecurityConstraint( sc );
d.addSecurityConstraint(securityConstraint);
d.addSecurityConstraint(securityConstraint);