Glassfish 3.1.1 JDBC Realm

I created jdbcRealm in Glassfish 3.1.1:

 <auth-realm name="db-realm" classname="com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm">
      <property name="user-name-column" value="username"></property>
      <property name="password-column" value="userpassword"></property>
      <property name="group-name-column" value="groupname"></property>
      <property description="null" name="group-table" value="group"></property>
      <property name="user-table" value="user"></property>
      <property name="datasource-jndi" value="jdbc/netponto"></property>
      <property name="jaas-context" value="jdbcRealm"></property>
      <property description="null" name="digest-algorithm" value="SHA-256"></property>
 </auth-realm>

Connection Pool is working well. My database (postgres) configuration's is ok.

My web.xml:

<login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>db-realm</realm-name>
</login-config>

My sun-web.xml:

<security-role-mapping>
       <role-name>admin</role-name>
       <group-name>admin</group-name>
</security-role-mapping>

When I try to request any protected and type user and password, glassfish throws exception:

WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception

User in database:

username: test userpassword: SHA-256 hash (test) group: admin

Is this glassfish 3.1.1 problem's?

Is there someone using jdbcRealm with Glassfish 3.1.1 and it's working?

My Environment: SO: Ubuntu 11.04 DB: Postgres 9 Java: 1.7.0 Glassfish: 3.1.1 (b12)

链接地址: http://www.djcxy.com/p/22084.html

上一篇: LoginException:登录失败:安全异常

下一篇: Glassfish 3.1.1 JDBC领域