custom realm using database

hi

I am trying custom realms for th efirst time....

I want to write custom realm which will authenticate user and password with there roles froem the datbase and will authenticate user ...

I am using java Sun System Application server 9.0 and Netbeans 5.5 Preview

.....will you please send me the information @ earliest

Thank You

Geetanjalee

[385 byte] By [Geetanjaleea] at [2007-10-2 16:01:29]
# 1
Just go thro' this link. http://java.sun.com/webservices/docs/1.6/tutorial/doc/XWS-SecuritySamples4.html
JK2004a at 2007-7-13 16:32:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

hi

i am done using Custom Realm but i am facing some problems

if i try to secure my web application using custome realm it works fine....

but when i try to access any functions on remote interface that throws me null pointer exception ,,,,,

my realms is properly seurying the web page which i secured...eg:

if i am securying index.jsp and after i get an access i am invoking a servlet in which

i have @EJB() AdvSessionFacadeRemote oAdveSessionFacade then

the oAdvSessionFacde is null and throws null pointer exception

but if i dont use security constrints in my web.xml ...the same servlet works fine i mean whithout using realms

why is it so ...do i need to add something to my web.xml

i have included this tag in my web.xml:

<security-constraint>

<display-name>SecurityConstraint</display-name>

<web-resource-collection>

<web-resource-name>WRCollection</web-resource-name>

<url-pattern>/index.jsp</url-pattern>

<url-pattern>/*</url-pattern>

</web-resource-collection>

<auth-constraint>

<role-name>loginUser</role-name>

</auth-constraint>

<user-data-constraint>

and i have also added :

<security-role-mapping>

<role-name>loginUser</role-name>

<group-name>a</group-name>

<group-name>userLogin</group-name>

</security-role-mapping>

to sun-web.xml

<transport-guarantee>NONE</transport-guarantee>

</user-data-constraint>

</security-constraint>

<login-config>

<auth-method>FORM</auth-method>

<realm-name>JDBCRealm</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>

for this application i have used netbeans 5.5 preview i checked in 5.5 beta there's a tab called security in web.xml which is not there in the preview version...so is it beacoz of that?

i have tried this link in netbeans 5.5 beta

http://www.netbeans.org/kb/articles/security-webapps.html

but point no 8 under using JDBC Authorization topic says:

8.Create the appropriate tables in jdbc/__default and add the proper data to the table.

so i am not able to get the cause of my problem ,can u plz suggest me something

thank you

Geetanjali

Geetanjaleea at 2007-7-13 16:32:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi,do you know how to forward to next page after the j_security_check , in case if i invoke login page directly.Please update me on jogesh.kanojia@patni.comThanks Jogesh
Jogesh_Kanojiaa at 2007-7-13 16:32:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...