i am using tomcat on linux, trying to authenticate users using waffle.
my META_INF/context.xml is
<?xml version='1.0' encoding='utf-8'?>
<Context>
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="Jaas"
userClassNames="waffle.jaas.UserPrincipal"
roleClassNames="waffle.jaas.RolePrincipal"
useContextClassLoader="false"
debug="true" />
</Context>
my error code is
Login exception authenticating username "amahajan"
javax.security.auth.login.LoginException: java.lang.UnsatisfiedLinkError: Unable to load library 'Advapi32': libAdvapi32.so: cannot open shared object file:
No such file or directory
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:194)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:283)
at com.sun.jna.Library$Handler.<init>(Library.java:142)
at com.sun.jna.Native.loadLibrary(Native.java:368)
at com.sun.jna.platform.win32.Advapi32.<clinit>(Advapi32.java:40)
at waffle.windows.auth.impl.WindowsAuthProviderImpl.logonDomainUserEx(Unknown Source)
at waffle.windows.auth.impl.WindowsAuthProviderImpl.logonDomainUser(Unknown Source)
at waffle.windows.auth.impl.WindowsAuthProviderImpl.logonUser(Unknown Source)
at waffle.jaas.WindowsLoginModule.login(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:433)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:354)
at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:573)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:886)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:433)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:354)
at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:573)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
my login.conf is
Jaas {
waffle.jaas.WindowsLoginModule sufficient debug=false;
};
in my web.xml i gave
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Jaas</realm-name>
</login-config>
<security-role>
<role-name>Everyone</role-name>
</security-role>
<security-constraint>
<display-name>Waffle Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Everyone</role-name>
</auth-constraint>
</security-constraint>
i think the error is how i start up tomcat and use it, i dont have any .policy file
after long research i found out waffle doesn't work on any *nix systems.