Waffle authentication not working in Windows

1.6k Views Asked by At

I'm trying to use Waffle in my Java with Tomcat 7 application, but the authentication with windows isn't working.

I have an web application which works fine, so I added Maven dependency to Waffle:

<dependency>
        <groupId>com.github.dblock.waffle</groupId>
        <artifactId>waffle-jna</artifactId>
        <version>1.7.4</version>
</dependency>

And I added the filter in my web.xml:

<filter>
<filter-name>SecurityFilter</filter-name>
<filter-class>waffle.servlet.NegotiateSecurityFilter</filter-class>
<init-param>
    <param-name>principalFormat</param-name>
    <param-value>fqn</param-value>
</init-param>
<init-param>
    <param-name>roleFormat</param-name>
    <param-value>both</param-value>
</init-param>
<init-param>
    <param-name>allowGuestLogin</param-name>
    <param-value>false</param-value>
</init-param>
<init-param>
    <param-name>impersonate</param-name>
    <param-value>false</param-value>
</init-param>
<init-param>
    <param-name>securityFilterProviders</param-name>
    <param-value>waffle.servlet.spi.NegotiateSecurityFilterProvider</param-value>
</init-param>
<init-param>
    <param-name>waffle.servlet.spi.NegotiateSecurityFilterProvider/protocols</param-name>
    <param-value>
            NTLM
            Negotiate
    </param-value>
</init-param>

<filter-mapping>
    <filter-name>SecurityFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

So, when I access my page, I open a login dialog and the user logs in. The problem I'm seeing is when the user has logged in once already and the dialog opens, the user needs to enter their credentials again as they're not getting saved. I've tried to use waffle to save their credentials using SSO, but in my console I always get this error:

[waffle.servlet.NegotiateSecurityFilter] error logging in user: com.sun.jna.platform.win32.Win32Exception:
0

There are 0 best solutions below