Class ElytronSecurityProvider
- java.lang.Object
-
- org.apache.camel.component.elytron.ElytronSecurityProvider
-
- All Implemented Interfaces:
org.apache.camel.component.undertow.spi.UndertowSecurityProvider
public class ElytronSecurityProvider extends Object implements org.apache.camel.component.undertow.spi.UndertowSecurityProvider
Implementation of `UndertowSecurityProvider` which adds elytron capability into camel-undertow. Provider requires instance of `ElytronSecurityConfiguration` to be provided as `securityConfiguration` parameter in camel-undertow.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SECURITY_IDENTITY_HEADER
Name of the header which contains associated security identity if request is authenticated.
-
Constructor Summary
Constructors Constructor Description ElytronSecurityProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptConfiguration(Object configuration, String endpointUri)
void
addHeader(BiConsumer<String,Object> consumer, io.undertow.server.HttpServerExchange httpExchange)
Provider adds header `securityIdentity` with value of type `SecurityIdentity` after successful authentication.int
authenticate(io.undertow.server.HttpServerExchange httpExchange, List<String> allowedRoles)
Authentication is verified by securityDomain from configuration.boolean
isAllowed(Set<String> roles, List<String> allowedRoles)
io.undertow.server.HttpHandler
wrapHttpHandler(io.undertow.server.HttpHandler httpHandler)
Elytron hook into undertow is by creation of wrapping httpHandler.
-
-
-
Field Detail
-
SECURITY_IDENTITY_HEADER
public static final String SECURITY_IDENTITY_HEADER
Name of the header which contains associated security identity if request is authenticated.- See Also:
- Constant Field Values
-
-
Method Detail
-
addHeader
public void addHeader(BiConsumer<String,Object> consumer, io.undertow.server.HttpServerExchange httpExchange) throws Exception
Provider adds header `securityIdentity` with value of type `SecurityIdentity` after successful authentication.- Specified by:
addHeader
in interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider
- Throws:
Exception
-
authenticate
public int authenticate(io.undertow.server.HttpServerExchange httpExchange, List<String> allowedRoles) throws Exception
Authentication is verified by securityDomain from configuration.- Specified by:
authenticate
in interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider
- Throws:
Exception
-
acceptConfiguration
public boolean acceptConfiguration(Object configuration, String endpointUri) throws Exception
- Specified by:
acceptConfiguration
in interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider
- Throws:
Exception
-
wrapHttpHandler
public io.undertow.server.HttpHandler wrapHttpHandler(io.undertow.server.HttpHandler httpHandler) throws Exception
Elytron hook into undertow is by creation of wrapping httpHandler.- Specified by:
wrapHttpHandler
in interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider
- Throws:
Exception
-
-