Package io.helidon.security.integration.webserver

Integration library for RxServer.

Example of integration (expects an instance of Security):

 // Web server routing builder - this is our integration point
 Routing routing = Routing.builder()
 // register the WebSecurity to create context (shared by all routes)
 .register(WebSecurity.from(security))
 // authenticate all paths under /user and require role "user"
 .get("/user[/{*}]", WebSecurity.authenticate()
 .rolesAllowed("user"))
 // authenticate "/admin" path and require role "admin"
 .get("/admin", WebSecurity.rolesAllowed("admin")
 .authenticate()
 )
 // build a routing instance to start WebServer with.
 .build();
 

The main security methods are duplicate - first as static methods on WebSecurity and then as instance methods on SecurityHandler that is returned by the static methods above. This is to provide a single starting point for security integration (WebSecurity) and fluent API to build the "gate" to each route that is protected.

See Also:
WebSecurity.create(io.helidon.security.Security), WebSecurity.create(io.helidon.config.Config), WebSecurity.create(io.helidon.security.Security, io.helidon.config.Config)