Johannes:
I posted this a while back. [
http://gesker.blogspot.com/2007/03/jspwikiglassfish-install-part-11-of-18.html].
The posting is/was part of a series of posts on setting up Glassfish.
JDBCRealm configuration was part of the setup walk through.
The directions should still be pretty close. The item that took a bit to
figure out was the "Default Principal to Role Mapping" check box on the
Security page under Configuration.
Dennis
On Tue, May 6, 2008 at 7:17 AM, <glassfish_at_javadesktop.org> wrote:
> I've been trying to set up JDBC Authentication for hours now. Could
> somebody help me to correctly set up my JDBC realm?
>
> * I am pretty sure the DB Connection works because I can ping the
> connection pool.
> * And I am pretty sure my Web Application is configured correctly since I
> am already using it to authenticate against a file realm.
> * I have set my server's log level for core.security to FINEST, and I am
> attaching the log output from when I am trying to log in.
>
> thank you for your help! Johannes
>
>
> Dienstag, 06. Mai 2008 14:55 Uhr Europe/Vienna
> [#|2008-05-06T14:55:56.576+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.web.security.WebSecurityManager;MethodName=setPolicyContext;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|[Web-Security]
> Policy Context ID was: SecurityTest/SecurityTest|#]
>
> [#|2008-05-06T14:55:56.576+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.web.security.WebSecurityManager;MethodName=hasUserDataPermission;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|[Web-Security]
> hasUserDataPermission perm: (javax.security.jacc.WebUserDataPermission
> /j_security_check POST)|#]
>
> [#|2008-05-06T14:55:56.576+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.web.security.WebSecurityManager;MethodName=hasUserDataPermission;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|[Web-Security]
> hasUserDataPermission isGranted: true|#]
>
> [#|2008-05-06T14:55:56.577+0200|FINEST|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.enterprise.security.auth.LoginContextDriver;MethodName=login;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|Processing
> login with credentials of type: class
> com.sun.enterprise.security.auth.login.PasswordCredential|#]
>
> [#|2008-05-06T14:55:56.577+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.enterprise.security.auth.LoginContextDriver;MethodName=doPasswordLogin;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|Logging
> in user [johannes] into realm: DBRealm using JAAS module: jdbcRealm|#]
>
> [#|2008-05-06T14:55:56.579+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.appserv.security.AppservPasswordLoginModule;MethodName=initialize;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|Login
> module initialized: class
> com.sun.enterprise.security.auth.login.JDBCLoginModule|#]
>
> [#|2008-05-06T14:55:56.988+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.appserv.security.AppservPasswordLoginModule;MethodName=abort;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|JAAS
> authentication aborted.|#]
>
> [#|2008-05-06T14:55:57.030+0200|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;johannes;|SEC5046:
> Audit: Authentication refused for [johannes].|#]
>
> [#|2008-05-06T14:55:57.030+0200|FINEST|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;ClassName=com.sun.enterprise.security.auth.LoginContextDriver;MethodName=doPasswordLogin;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|doPasswordLogin
> fails
> javax.security.auth.login.LoginException: Security Exception
> at
> javax.security.auth.login.LoginContext.invoke(LoginContext.java:856)
> at
> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
> at
> javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
> at
> javax.security.auth.login.LoginContext.login(LoginContext.java:579)
> at
> com.sun.enterprise.security.auth.LoginContextDriver.doPasswordLogin(LoginContextDriver.java:295)
> at
> com.sun.enterprise.security.auth.LoginContextDriver.login(LoginContextDriver.java:170)
> at
> com.sun.enterprise.security.auth.LoginContextDriver.login(LoginContextDriver.java:123)
> at
> com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:479)
> at
> com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:419)
> at
> org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:253)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.processSecurityCheck(AuthenticatorBase.java:1011)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:622)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:609)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at
> com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> Caused by: java.lang.SecurityException
> at
> javax.security.auth.login.LoginContext.invoke(LoginContext.java:857)
> ... 35 more
> |#]
>
> [#|2008-05-06T14:55:57.032+0200|WARNING|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=f846c660-00a2-4ba5-9424-89359edb15c6;|Web
> login failed: Login failed: javax.security.auth.login.LoginException:
> Security Exception|#]
>
> [#|2008-05-06T14:55:57.057+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=20;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=com.sun.web.security.WebSecurityManager;MethodName=setPolicyContext;_RequestID=39df5928-ee07-4e89-be9b-78cacfe3f381;|[Web-Security]
> Policy Context ID was: SecurityTest/SecurityTest|#]
>
> [#|2008-05-06T14:55:57.057+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=20;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=com.sun.web.security.WebSecurityManager;MethodName=hasUserDataPermission;_RequestID=39df5928-ee07-4e89-be9b-78cacfe3f381;|[Web-Security]
> hasUserDataPermission perm: (javax.security.jacc.WebUserDataPermission
> /loginerror.jsp GET)|#]
>
> [#|2008-05-06T14:55:57.058+0200|FINE|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=20;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=com.sun.web.security.WebSecurityManager;MethodName=hasUserDataPermission;_RequestID=39df5928-ee07-4e89-be9b-78cacfe3f381;|[Web-Security]
> hasUserDataPermission isGranted: true|#]
> [Message sent by forum member 'johannesh' (johannesh)]
>
> http://forums.java.net/jive/thread.jspa?messageID=272944
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
--
Dennis R. Gesker
email: dennis_at_gesker.com
Key Id: 0xEFA10A51
First things first, but not necessarily in that order. -- Unknown