É, acho que estava bom demais pra ser verdade.
Ainda não consegui fazer um jdbcrealm funcionar no glassfish e qual é o segredo ? ALguém já conseguiu? Agradeceria se alguem pudesse me dar uma dica. :roll:
Estou usando o netbeans + glassfish.
Abaixo os arquivos de configuração e o log do problema ao tentar fazer o login na aplicação web.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>SecurityConstraint</display-name>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>User</role-name>
<role-name>Admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>UsersDataBase</realm-name>
<form-login-config>
<form-login-page>/logon.jsp</form-login-page>
<form-error-page>/logonError.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>User</role-name>
</security-role>
<security-role>
<description/>
<role-name>Admin</role-name>
</security-role>
</web-app>
sun-web.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
/sparkApp Keep a copy of the generated servlet class' java code. User User User Admin Admin Admin [/code]Erro ao tentar fazer o login:
;_RequestID=4d46badf-2b1d-4b76-926f-a8e1cd8579f8;|SEC1111: Cannot load group for JDBC realm user [teste], reason: java.sql.SQLException: ORA-00904: "LOGIN": identificador inválido
[LoginContext]: original security exception with detail msg replaced by new exception with empty detail msg
[LoginContext]: original security exception: com.sun.enterprise.security.LoginException: Failed jdbc login for teste.
[LoginContext]: login REQUIRED failure
[LoginContext]: abort ignored
SEC5046: Audit: Authentication refused for [teste].
Web login failed: Login failed: javax.security.auth.login.LoginException: Security Exception
Eu nao entendi que diabo de SQL é este que ele tenta fazer, já chequei as tabelas e os campos mas não vejo porque ele está dando pau…
abs