Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from 2.6.2 to 2.7.2: HTTP basic authentication doesn't work #312

Closed
binhthai opened this Issue Nov 24, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@binhthai
Copy link

binhthai commented Nov 24, 2017

Hi,

I am upgrading Citrus 2.6.2 to 2.7.2 and facing an issue regarding HTTP basic authentication.
I get HTTP-401.
Example of a config (Citrus 2.6.2):

<bean id="securityHandler" class="com.consol.citrus.http.security.SecurityHandlerFactory">
    <property name="users">
        <list>
            <bean class="com.consol.citrus.http.security.User">
                <property name="name" value="${server.user}"/>
                <property name="password" value="${server.password}"/>
                <property name="roles" value="${server.user}"/>
            </bean>
        </list>
    </property>
    <property name="constraints">
        <map>
            <entry key="/*">
                <bean class="com.consol.citrus.http.security.BasicAuthConstraint">
                    <constructor-arg value="${server.user}"/>
                </bean>
            </entry>
        </map>
    </property>
</bean>

As per latest citrus-samples/sample-http-basic-auth it seems that with Citrus 2.7.2 we need to pass an org.eclipse.jetty.security.HashLoginService to the security-handler.
I'm not sure whether the assumption is correct and would like to ask for an 'official guide'.
It would be nice if you could provide an example config (XML-based).

Thank you very much in advance

Best regards,

Binh

@christophd christophd added this to the v2.7.3 milestone Nov 24, 2017

@christophd

This comment has been minimized.

Copy link
Member

christophd commented Nov 24, 2017

Duplicate to #290

@christophd

This comment has been minimized.

Copy link
Member

christophd commented Nov 24, 2017

You can use the workaround described in #290 and use it in your XML config as follows:

<bean class ="com.example.HttpServerBasicAuthConfig"/>

@christophd christophd closed this Nov 27, 2017

@binhthai

This comment has been minimized.

Copy link
Author

binhthai commented Nov 27, 2017

Thank you very much Christoph!
You are too fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.