Re: Custom UserManager - Problem Solved!
I finally got my custom user manager working. I put an empty principals.xml in my application, it only had enough tags to meet the DTD, but didn't have any users or groups in it. I also put an orion-application.xml into my application specifying the custom user manager, and then packaged all that up into my '.ear' file. But here is what was causing the problem, orion-1.4.5 does not update those files when the application is re-deployed. I'm not sure if this is a bug or configurable somewhere, but ultimately that is what was causing my grief! I appreciate all the suggestions and was able to incorporate some of them in my code already! Thanks for the help Original Message On 3/16/01, 3:39:38 PM, Matthew R Bauer [EMAIL PROTECTED] wrote regarding Re: Custom UserManager.: Don't user setParent. Just leave it as an empty method. I do that and it works just fine. Matt On Fri, 16 Mar 2001, Michael Gantz wrote:
RE: Custom UserManager - Problem Solved!
oops... I should have told you this little secret. The only way I got my user manager to work was modifying the application-xml in the deployment directory. I could never find a configuration that did this automaticly. Regards, Elephantwalker -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Saturday, March 17, 2001 7:23 AM To: Orion-Interest Subject: Re: Custom UserManager - Problem Solved! I finally got my custom user manager working. I put an empty principals.xml in my application, it only had enough tags to meet the DTD, but didn't have any users or groups in it. I also put an orion-application.xml into my application specifying the custom user manager, and then packaged all that up into my '.ear' file. But here is what was causing the problem, orion-1.4.5 does not update those files when the application is re-deployed. I'm not sure if this is a bug or configurable somewhere, but ultimately that is what was causing my grief! I appreciate all the suggestions and was able to incorporate some of them in my code already! Thanks for the help Original Message On 3/16/01, 3:39:38 PM, Matthew R Bauer [EMAIL PROTECTED] wrote regarding Re: Custom UserManager.: Don't user setParent. Just leave it as an empty method. I do that and it works just fine. Matt On Fri, 16 Mar 2001, Michael Gantz wrote:
RE: Custom UserManager.
Michael, Are you using RoleManager to do a login? The call should look something like this (pulled from our CheckLogin action): // Login InitialContext context = new InitialContext(); RoleManager roleManager = (RoleManager) context.lookup("java:comp/RoleManager"); roleManager.login(username, password); There is a little bit of documentation on it's use in the docs directory at: \orion\docs\api\com\evermind\security\RoleManager.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Friday, March 16, 2001 12:40 AM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager.
Slight progress update. I'm convinced now I don't have something configured correctly. In my UserManager, when setParent is called I did a setParent(this) on the parent that was passed in. After that, my manager started receiving method calls to things like getUser. I also noticed that my setParent was being called with an XMLUserManager as it's parameter. Hopefully somebody can shine some light on this situation for me. Thanks... Original Message On 3/16/01, 12:40:06 AM, Michael Gantz [EMAIL PROTECTED] wrote regarding Custom UserManager.: Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager.
The DataSourceUserManager that is provided with Orion exhibits this same problem - the principals.xml must still contain the group declarations. We've created out own custom UserManager that uses our User and Group EJBs. This custom user manager will work fine for EJB and Web modules without anything in the principals.xml, but it fails miserably with Application Client modules. It is impossible to login with Application Clients no matter what's in the DB or in principals.xml. P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: "Christian Billen" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, March 16, 2001 2:17 AM Subject: RE: Custom UserManager. I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager.
When using a custom user manager with an application, you must make sure you are getting your DataSource references in the constructor. This is extremely important. If you try to lookup the DataSource outside of the constructor, you will have all sorts of problems. Do something like this... private DataSource ds; public MyUserManager() { ... try { InitialContext context = new InitialContext(); ds = (DataSource) context.lookup("jdbc/OraclePooledDS"); } catch (NamingException ne) { ne.printStackTrace(); } } public Connection getConnection() throws SQLException { return ds.getConnection(); } James Birchfield Ironmax maximizing your construction equipment assets 5 Corporate Center 9960 Corporate Campus Drive, Suite 2000 Louisville, KY 40223 "Peter Pontbriand" peter.pontbriand@canlink.To: Orion-Interest [EMAIL PROTECTED] com cc: Sent by: Subject: Re: Custom UserManager. owner-orion-interest@orion server.com 03/16/01 10:14 AM Please respond to Orion-Interest The DataSourceUserManager that is provided with Orion exhibits this same problem - the principals.xml must still contain the group declarations. We've created out own custom UserManager that uses our User and Group EJBs. This custom user manager will work fine for EJB and Web modules without anything in the principals.xml, but it fails miserably with Application Client modules. It is impossible to login with Application Clients no matter what's in the DB or in principals.xml. P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: "Christian Billen" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, March 16, 2001 2:17 AM Subject: RE: Custom UserManager. I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
RE: Custom UserManager.
Ernie, No, I'm using BASIC and FORM authorization, and I'm trying really badly to not have to have any Users or Groups in principals.xml. I have a separate system that contains login and roles information. I did find (mentioned in another post that I myself made) that if I do a parent.setParent(this) in my UserManagers setParent method that things actually work correctly, I have no idea why this is. When my setParent method gets called it is passed an XMLUserManager as the parent, I think what is happening is, with the principals file gone, that the real UserManager sees mine as the parent and defaults to it, as opposed to working the other way around. Maybe that wasn't as clear as I had hoped, I'm calling setParent(this) on the usermanager that is passed as an argument to my usermanagers setParent method. The difficulty of this issue really concerns me because J2ee is not very useful if I have to duplicate my user and roles data into a server specific location, and then try and maintain both sets of data. Thanks From: Ernie Phelps Subject: RE: Custom UserManager. Date: Fri, 16 Mar 2001 04:41:15 -0800 Michael, Are you using RoleManager to do a login? The call should look something like this (pulled from our CheckLogin action): // Login InitialContext context = new InitialContext(); RoleManager roleManager = (RoleManager) context.lookup("java:comp/RoleManager"); roleManager.login(username, password); There is a little bit of documentation on it's use in the docs directory at: \orion\docs\api\com\evermind\security\RoleManager.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Friday, March 16, 2001 12:40 AM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz -- Michael L. Gantz Great Lakes Technology Group [EMAIL PROTECTED]
RE: Custom UserManager.
I have a fully functional home-brewn imp. of UserManager and I do nothing in the setParent method. Just for you to know, HTH JP -Original Message- From: Michael Gantz [mailto:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 9:24 AM To: Orion-Interest Subject: Re: Custom UserManager. Slight progress update. I'm convinced now I don't have something configured correctly. In my UserManager, when setParent is called I did a setParent(this) on the parent that was passed in. After that, my manager started receiving method calls to things like getUser. I also noticed that my setParent was being called with an XMLUserManager as it's parameter. Hopefully somebody can shine some light on this situation for me. Thanks... Original Message On 3/16/01, 12:40:06 AM, Michael Gantz [EMAIL PROTECTED] wrote regarding Custom UserManager.: Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager.
Good point. However, our User and Group EJBs are exclusively CMP - we don't get any DataSources outside of the constructor or inside it. We'll give the delegate-to-parent-UserManager trick a shot, but I still think that such things should be unnecessary. Why should the fact that a client is an Application Client Module rather than a Web Module make any difference to the way UserManager implementations work? P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Cc: "Orion-Interest" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 16, 2001 11:51 AM Subject: Re: Custom UserManager. When using a custom user manager with an application, you must make sure you are getting your DataSource references in the constructor. This is extremely important. If you try to lookup the DataSource outside of the constructor, you will have all sorts of problems. Do something like this... private DataSource ds; public MyUserManager() { ... try { InitialContext context = new InitialContext(); ds = (DataSource) context.lookup("jdbc/OraclePooledDS"); } catch (NamingException ne) { ne.printStackTrace(); } } public Connection getConnection() throws SQLException { return ds.getConnection(); } James Birchfield Ironmax maximizing your construction equipment assets 5 Corporate Center 9960 Corporate Campus Drive, Suite 2000 Louisville, KY 40223 "Peter Pontbriand" peter.pontbriand@canlink.To: Orion-Interest [EMAIL PROTECTED] com cc: Sent by: Subject: Re: Custom UserManager. owner-orion-interest@orion server.com 03/16/01 10:14 AM Please respond to Orion-Interest The DataSourceUserManager that is provided with Orion exhibits this same problem - the principals.xml must still contain the group declarations. We've created out own custom UserManager that uses our User and Group EJBs. This custom user manager will work fine for EJB and Web modules without anything in the principals.xml, but it fails miserably with Application Client modules. It is impossible to login with Application Clients no matter what's in the DB or in principals.xml. P. Pontbriand Canlink Interactive Technologies Inc. - Original Message - From: "Christian Billen" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, March 16, 2001 2:17 AM Subject: RE: Custom UserManager. I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager.
Don't user setParent. Just leave it as an empty method. I do that and it works just fine. Matt On Fri, 16 Mar 2001, Michael Gantz wrote: Slight progress update. I'm convinced now I don't have something configured correctly. In my UserManager, when setParent is called I did a setParent(this) on the parent that was passed in. After that, my manager started receiving method calls to things like getUser. I also noticed that my setParent was being called with an XMLUserManager as it's parameter. Hopefully somebody can shine some light on this situation for me. Thanks... Original Message On 3/16/01, 12:40:06 AM, Michael Gantz [EMAIL PROTECTED] wrote regarding Custom UserManager.: Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
RE: Custom UserManager.
I don't know what type of User manager you made, but I had problems using EJBUserManager, I had to leave the principals.xml containing all my groups (not my users) and the link to it in orion-application.xml. I struggled for a while on this since it doesn't make sense as all my users are in the database. Maybe it is something related somehow and you could try it out? Christian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael Gantz Sent: Thursday, March 15, 2001 11:40 PM To: Orion-Interest Subject: Custom UserManager. Server : Orion-1.4.5 I've created a custom UserManager and referenced it in application.xml, I've taken out the principal tags in all the other files. Here is my problem: my custom user manager loads up and the init method gets called but that's it. The server never calls getUser on my user manager. I'm very sure I'm missing something really silly and simple but I can't find it due to the complete lack of adequate documentation. Thanks in advance. Michael L. Gantz
Re: Custom UserManager - naming context
First; to use a new EJB with the EJBUserManager you only need to use an EJB where the bean implements UserEJB (ie it's remote extends upon that interface), that's the solution most customers wanting to do this (using their own EJBs as the source of user info). If you dont use username as primary key you can add a "findByUsername" method in the home interface which will in that case be used. The EJBUserManager creates the InitialContext instance in the init(...) method (where the context exists). There should "always" be a context when the usermanager is called though - this wasnt always the case in 0.9.6 but all instances where this occur has been fixed in the latest internal jar. Hope it helps. :) /Magnus Stenman, the Orion team - Original Message - From: "Nick Newman" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Monday, April 24, 2000 6:16 PM Subject: Custom UserManager - naming context I would like to be able to log on to an Orion web-application by verifying the password against an encrypted value (as in a regular unix password file). It seems that to do this I must provide custom implementations of the UserManager and the User interfaces, and indeed I can get a solution to work in this way. I would prefer to use a solution in which an entity EJB acted as an interface to the password table, but I do not know how to access an EJB's home interface from within the UserManager code. If I try the usual scheme I get a NamingException saying "Not in application scope", which is true. The EJBUserManager supplied with Orion must overcome this same problem, so it must be possible, but I don't have access to its code. Any ideas? Thanks, Nick