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 StringSECURITY_IDENTITY_HEADERName 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 booleanacceptConfiguration(Object configuration, String endpointUri)voidaddHeader(BiConsumer<String,Object> consumer, io.undertow.server.HttpServerExchange httpExchange)Provider adds header `securityIdentity` with value of type `SecurityIdentity` after successful authentication.intauthenticate(io.undertow.server.HttpServerExchange httpExchange, List<String> allowedRoles)Authentication is verified by securityDomain from configuration.booleanisAllowed(Set<String> roles, List<String> allowedRoles)io.undertow.server.HttpHandlerwrapHttpHandler(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:
addHeaderin interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider- Throws:
Exception
-
authenticate
public int authenticate(io.undertow.server.HttpServerExchange httpExchange, List<String> allowedRoles) throws ExceptionAuthentication is verified by securityDomain from configuration.- Specified by:
authenticatein interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider- Throws:
Exception
-
acceptConfiguration
public boolean acceptConfiguration(Object configuration, String endpointUri) throws Exception
- Specified by:
acceptConfigurationin interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider- Throws:
Exception
-
wrapHttpHandler
public io.undertow.server.HttpHandler wrapHttpHandler(io.undertow.server.HttpHandler httpHandler) throws ExceptionElytron hook into undertow is by creation of wrapping httpHandler.- Specified by:
wrapHttpHandlerin interfaceorg.apache.camel.component.undertow.spi.UndertowSecurityProvider- Throws:
Exception
-
-