aspose file tools*
The moose likes Websphere and the fly likes Implementation of User Registry with ORacle database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Implementation of User Registry with ORacle database" Watch "Implementation of User Registry with ORacle database" New topic
Author

Implementation of User Registry with ORacle database

aanchal mathur
Greenhorn

Joined: Sep 13, 2001
Posts: 29
I have a web application with needs it authentication and authorization to be done using the Oracle9ias database. Hence i am making use of the UserRegistry class. I wrote my own class which implements the User Registry class. My doubts are as follows :
1). My implementation class "com.testexample.UserRegistryExample" is part of the ear. Now i read at many sites that the same class file should also be available in the class path. So what i did was , i put a copy of the jar part from the ear into the WASHOME/lib/ext directory. Do you think its correct to do that or we need to do it another way.
2). I have to implement Basic Authentication in my example. So i put in the configuration for Basic Authentication in the web.xml. Now i have my application deployed successfully and my CustomRegistry file in place, but each time i access my application from the browser , it doesnt bring up the authentication window at all , instead just brings up the jsp page with a few JSP Compilation error.
The contents of my web.xml file is as follows :


< security-constraint >
< web-resource-collection >
< web-resource-name >Bean Test Site< /web-resource-name >
< description >beantest directory</ description >
< url-pattern >/beantest/RobotEJBTest.jsp</ url-pattern >
< http-method >POST</ http-method >
< http-method >GET</ http-method >
</ web-resource-collection >
< web-resource-collection >
< web-resource-name >Administration</ web-resource-name >
< url-pattern >/tree.do</ url-pattern >
</ web-resource-collection >
< auth-constraint >
< role-name >a2g.supervisor< /role-name >
< role-name >a2g.admin</ role-name >
< role-name >a2g.depart-admin</ role-name >
< role-name >a2g.subdepart-admin</ role-name >
< role-name >a2g.cashier</ role-name>
</ auth-constraint >

< user-data-constraint>
< description >SSL not required</ description >
< transport-guarantee >NONE</ transport-guarantee >
</ user-data-constraint >
</ security-constraint >



The above is a listing as it exists in the web.xml file. So hope you can help me in finding out why i am not gettin the web based based authentication window in the browser each time i click on /tree.do

Thanx
aanchal.

[ May 13, 2004: Message edited by: aanchal mathur ]

[ May 14, 2004: Message edited by: aanchal mathur ]
[ May 14, 2004: Message edited by: aanchal mathur ]
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
(1) Look at this redbook which walks through the whole process.

(2) Sounds like the JSP compilation errors are unrelated. You should try to fix those first.

(3) Insert spaces between the opening angle bracket "<" and the rest of each XML tag so people can see your web.xml.

Kyle
[ May 13, 2004: Message edited by: Kyle Brown ]

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
aanchal mathur
Greenhorn

Joined: Sep 13, 2001
Posts: 29
Hi Kyle,

I am working on Websphere v5.1 and the Redbook link u sent me was for v5.0 . Am not sure if there is much of a difference between the
2 versions.
I did go thru the doc but am very confused with the few things related to the Security model.

1). If i have multiple applications installed on websphere, i need to setup the Application Level Security . But from the many sites and
the Redbook i read, all i could figure out was that Websphere uses a "GLobal Security" and all Applications deployed on that server
have to make use of that Security which is defined on a global level ? Can u confirm the same for me.Incase i'm wrong then wat is the
rite way.

2).Why is it that i have to have the security related Class file i.e incase of CustomRegistry to be part of the Classpath.My security
related class file which implements the CustomRegistry of Websphere is part of the EAR then cant Webphere grab that file from the
installed folders instead of the ear or jar file being part of the classpath?

3). Can i have application level security enabled and global security disabled?

4). I have my jar file copied in the %WAS_HOME%/lib directory , after which WAS could get the USERRegistry file. But that UserREGISTRY file
is calling internal application level files which are part of the jar file also. But each time i start up the server it keeps giving a message
that "com/test/testSecurityEngine" not found. i.e the files packaged in with the UserRegitry file and being imported in the UserRegistry
cannot be found? Why am i gettin this error.

5). Also to get rid of this error i added an extra line in the setupCmdLine.bat file i.e a line to the WAS_CLASSPATH which basically is
pointing to my applications 'jar' file in the WAS lib dir. But inspite of doing so i still get "File not found" problem as mentioned
above in pt.no 4.Why?

This is it for now. More questions as I more ahead .

thanx
aanchal.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Let me try to answer as many of these as I can in line.

Originally posted by aanchal mathur:
Hi Kyle,

I am working on Websphere v5.1 and the Redbook link u sent me was for v5.0 . Am not sure if there is much of a difference between the
2 versions.
I did go thru the doc but am very confused with the few things related to the Security model.


There are no substantial differences in Security between WAS 5.0 and 5.1. It all works the same.


1). If i have multiple applications installed on websphere, i need to setup the Application Level Security . But from the many sites and
the Redbook i read, all i could figure out was that Websphere uses a "GLobal Security" and all Applications deployed on that server
have to make use of that Security which is defined on a global level ? Can u confirm the same for me.Incase i'm wrong then wat is the
rite way.


Yes, you configure some security settings (such as which user registry to use) globally for the Entire WebSphere Cell. You must do that in order to let the different applications in your cell share the same security credentials. You can't use one registry for one application and another registry for a different one -- to do that requires multiple cells.



2).Why is it that i have to have the security related Class file i.e incase of CustomRegistry to be part of the Classpath.My security
related class file which implements the CustomRegistry of Websphere is part of the EAR then cant Webphere grab that file from the
installed folders instead of the ear or jar file being part of the classpath?




See the answer above. It's global, so it must be on the global WAS classpath an not in your EAR.


3). Can i have application level security enabled and global security disabled?



No.



4). I have my jar file copied in the %WAS_HOME%/lib directory , after which WAS could get the USERRegistry file. But that UserREGISTRY file
is calling internal application level files which are part of the jar file also. But each time i start up the server it keeps giving a message
that "com/test/testSecurityEngine" not found. i.e the files packaged in with the UserRegitry file and being imported in the UserRegistry
cannot be found? Why am i gettin this error.



I don't have your code, so I can't answer why it can't find your own classes. Packing them all into a JAR you place in the WAS lib directory should do everything you need.



5). Also to get rid of this error i added an extra line in the setupCmdLine.bat file i.e a line to the WAS_CLASSPATH which basically is
pointing to my applications 'jar' file in the WAS lib dir. But inspite of doing so i still get "File not found" problem as mentioned
above in pt.no 4.Why?

This is it for now. More questions as I more ahead .

thanx
aanchal.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implementation of User Registry with ORacle database