Blueprint service reference to org.eclipse.jetty.security.ConstraintSecurityHandler ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Blueprint service reference to org.eclipse.jetty.security.ConstraintSecurityHandler ?

Gerald Kallas - mailbox.org
Dear community,

I'm using in one Blueprint DSL file

        <bean id="securityHandlerImpl" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
                <property name="loginService">
                        <bean class="org.eclipse.jetty.security.HashLoginService">
                                <property name="config" value="/opt/apache-karaf/etc/users.properties"/>
                        </bean>
                </property>
                <property name="authenticator">
                        <bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
                </property>
                <property name="constraintMappings">
                        <list>
                                <ref component-id="constraintMapping_TSTISP001"/>
                                <ref component-id="constraintMapping_TSTISP002"/>
                        </list>
                </property>
        </bean>

        <service id="securityHandler" ref="securityHandlerImpl" interface="org.eclipse.jetty.security.ConstraintAware" />

and want to refer in another on to the service like

        <reference id="securityHandler" interface="org.eclipse.jetty.security.ConstraintAware" ext:proxy-method="default" />

Finally I'm getting an error

Caused by: java.lang.ClassCastException: Cannot cast Proxy01b089da_287a_40a5_987b_b3aa8d37c5b7 to org.eclipse.jetty.server.Handler


I wanted to switch to the other interface
https://www.eclipse.org/jetty/javadoc/9.4.6.v20170531/org/eclipse/jetty/security/Authenticator.AuthConfiguration.html

but the reference

        <service id="securityHandler" ref="securityHandlerImpl" interface="org.eclipse.jetty.security.Authenticator.AuthConfiguration" />

causes an

missing requirement [isp.jettyHttpComponent.xml [317](R 317.16)] osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.security.Authenticator) Unresolved requirements: [[isp.jettyHttpComponent.xml [317](R 317.16)] osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.security.Authenticator)]


Does anyone have defined a securityHandler and set a Blueprint service reference with this?

Many thanks in advance
- Gerald