Product SiteDocumentation Site

⁠12.4.5. Write Your Own Path Authorizer

If none of the built-in authorization methods fullfil your requirements, you can always provide your own implementation.
To configure your custom authorization method for a specific path you just need to:
​httpBuilder
​    .forPath("/custom/protected/*")
​        .authorizeWith()
​            .authorizer(MyCustomPathAuthorizer.class);
In order to provide your own authorization logic you must provide an implementation for the org.picketlink.http.authorization.PathAuthorizer interface.
​public static class CustomPathAuthorizer implements PathAuthorizer {
​
​        @Override
​        public boolean authorize(PathConfiguration pathConfiguration, HttpServletRequest request, HttpServletResponse response) {
​            // perform authorization
​        }
​    }
org.picketlink.http.authorization.PathAuthorizer types are just regular CDI beans.