java ee - TomEE, JAAS, SQLLoginModule and 403 -


i have added sqlloginmodule deployment (tomee 1.5.1):

  1. system property points login.config
  2. login.config configured use sqllogin realm
  3. server.xml updated use realm

here's web.xml (i'm sure problem here)

<security-constraint>     <display-name>unsecured</display-name>     <web-resource-collection>         <web-resource-name>unsecured area</web-resource-name>         <url-pattern>/login.html</url-pattern>     </web-resource-collection>     <user-data-constraint>         <transport-guarantee>confidential</transport-guarantee>     </user-data-constraint> </security-constraint>  <security-constraint>     <web-resource-collection>         <web-resource-name>entire application</web-resource-name>         <url-pattern>*.html</url-pattern>     </web-resource-collection>     <auth-constraint>         <role-name>admin</role-name>         <role-name>superuser</role-name>         <role-name>user</role-name>     </auth-constraint>     <user-data-constraint>         <transport-guarantee>confidential</transport-guarantee>     </user-data-constraint> </security-constraint>  <security-role>     <role-name>admin</role-name> </security-role> <security-role>     <role-name>superuser</role-name> </security-role> <security-role>     <role-name>user</role-name> </security-role>  <login-config>     <auth-method>form</auth-method>     <realm-name>sqllogin</realm-name>     <form-login-config>         <form-login-page>/login.html</form-login-page>         <form-error-page>/login.html</form-error-page>     </form-login-config> </login-config>  <welcome-file-list>     <welcome-file>testrest.html</welcome-file> </welcome-file-list> 

deploying , logging-in, remote debugged org.apache.openejb.core.security.jaas.sqlloginmodule no exceptions, reason redirection welcome-file fails , 403 access-denied error.

any thoughts?

so, here solution after personal "via dolorosa" :)
first, error in server.xml jaasrealm configuration.
using instruction @ http://tomee.apache.org/tomee-jaas.html used

userclassnames="org.apache.openejb.core.security.abstractsecurityservice$user" roleclassnames="org.apache.openejb.core.security.abstractsecurityservice$group" 

after downloading tomcat sources , debugging found out actual generated principals org.apache.openejb.core.security.jaas.sqlloginmodule are:

userclassnames="org.apache.openejb.core.security.jaas.userprincipal" roleclassnames="org.apache.openejb.core.security.jaas.groupprincipal" 

that solved problem.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -