Map<String, Object> serverConfig = new HashMap<>();
serverConfig.put("jboss.remoting.security.username", "admin");
serverConfig.put("jboss.remoting.security.password", "password");
Server server = new Server(serverConfig);
server.start();
public class AuthorizationInterceptor implements Interceptor {
public Object invoke(InterceptorInvocation invocation) throws Throwable {
if (hasPermission(invocation.getMethod(), invocation.getTarget())) {
return invocation.invokeNext();
} else {
throw new SecurityException("Access denied.");
}
}
}
Map<String, Object> serverConfig = new HashMap<>();
serverConfig.put("jboss.remoting.security.authorizer", new AuthorizationInterceptor());
Server server = new Server(serverConfig);
server.start();
<remoting xmlns="urn:jboss:remoting:3.0">
<channel name="default">
<csrf-protection enabled="true" />
</channel>
</remoting>