Class 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 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
    • Constructor Detail

      • ElytronSecurityProvider

        public ElytronSecurityProvider()
    • 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 interface org.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 interface org.apache.camel.component.undertow.spi.UndertowSecurityProvider
        Throws:
        Exception
      • acceptConfiguration

        public boolean acceptConfiguration​(Object configuration,
                                           String endpointUri)
                                    throws Exception
        Specified by:
        acceptConfiguration in interface org.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 interface org.apache.camel.component.undertow.spi.UndertowSecurityProvider
        Throws:
        Exception