M
manu
jboss-web.xml contains
<jboss-web>
<security-domain>java:/jaas/wizomLogin</security-domain>
<context-root>/test</context-root>
</jboss-web>
login.html
<html>
<body>
<h1>Please Authenticate</h1>
<form method="POST" action="j_security_check">
User Name: <input type="text" name="j_username" /><br />
Password: <input type="password" name="j_password" /><br />
<input type="submit" value="Login" />
</form>
</body>
</html>
web.xml contains
<web-app>
<description>A test app for security</description>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>All resources</web-resource-name>
<description>Protects all resources</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>WebAppUser</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>WebAppUser</role-name>
</security-role>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
</web-app>
login-config.xml conatins
<application-policy name = "wizomLogin">
<authentication>
<login-module code =
"org.jboss.security.auth.spi.DatabaseServerLoginModule" flag =
"required">
<module-option name = "dsJndiName">java:mySqlWizom</module-option>
<module-option name = "principalsQuery">Select password from userInfo
where userInfo.username=?</module-option>
<module-option name = "rolesQuery">Select role,'Roles' from wizomRole
where wizomRole.username=?</module-option>
<module-option name="unauthenticatedIdentity">guest</module-option>
</login-module>
</authentication>
</application-policy>
database conatins tables
userInfo with username and password
wizom wizom
wizomRole with username and role
wizom WebUserApp
still login does not work
instead if i used application policy that reads username password
roles from file that will work.
please post me the solution.
<jboss-web>
<security-domain>java:/jaas/wizomLogin</security-domain>
<context-root>/test</context-root>
</jboss-web>
login.html
<html>
<body>
<h1>Please Authenticate</h1>
<form method="POST" action="j_security_check">
User Name: <input type="text" name="j_username" /><br />
Password: <input type="password" name="j_password" /><br />
<input type="submit" value="Login" />
</form>
</body>
</html>
web.xml contains
<web-app>
<description>A test app for security</description>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>All resources</web-resource-name>
<description>Protects all resources</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>WebAppUser</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>WebAppUser</role-name>
</security-role>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
</web-app>
login-config.xml conatins
<application-policy name = "wizomLogin">
<authentication>
<login-module code =
"org.jboss.security.auth.spi.DatabaseServerLoginModule" flag =
"required">
<module-option name = "dsJndiName">java:mySqlWizom</module-option>
<module-option name = "principalsQuery">Select password from userInfo
where userInfo.username=?</module-option>
<module-option name = "rolesQuery">Select role,'Roles' from wizomRole
where wizomRole.username=?</module-option>
<module-option name="unauthenticatedIdentity">guest</module-option>
</login-module>
</authentication>
</application-policy>
database conatins tables
userInfo with username and password
wizom wizom
wizomRole with username and role
wizom WebUserApp
still login does not work
instead if i used application policy that reads username password
roles from file that will work.
please post me the solution.