Package io.helidon.webserver.security
package io.helidon.webserver.security
Helidon WebServer Security Support.
Example of integration (expects an instance of Security
):
// WebServer routing builder - this is our integration pointHttpRouting
routing = HttpRouting.builder() // register the WebSecurity to create context (shared by all routes) .register(SecurityHttpFeature
.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 startWebServer
with. .build();
The main security methods are duplicate - first as static methods on SecurityHttpFeature
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 (SecurityHttpFeature
)
and fluent API to build the "gate" to each route that is protected.
- See Also:
-
ClassDescriptionInterface generated from definition.Fluent API builder for
PathsConfig
.PathsConfig.BuilderBase<BUILDER extends PathsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends PathsConfig> Fluent API builder base forPathsConfig
.Generated implementation of the prototype, can be extended by descendant prototype implementations.Server feature for security, to be registered withWebServerConfig.BuilderBase.addFeature(io.helidon.webserver.spi.ServerFeature)
.Configuration of security feature fow webserver.Fluent API builder forSecurityFeature
.SecurityFeatureConfig.BuilderBase<BUILDER extends SecurityFeatureConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends SecurityFeatureConfig> Fluent API builder base forSecurityFeature
.Generated implementation of the prototype, can be extended by descendant prototype implementations.ServiceLoader
provider implementation ofServerFeatureProvider
for security.Handles security for web server.Handler of query parameters - extracts them and stores them in a security header, so security can access them.Configuration of aSecurityHandler
.Fluent API builder forSecurityHandler
.SecurityHandlerConfig.BuilderBase<BUILDER extends SecurityHandlerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends SecurityHandlerConfig> Fluent API builder base forSecurityHandler
.Generated implementation of the prototype, can be extended by descendant prototype implementations.Integration of security into WebServer.