users@glassfish.java.net

RE: How do I add (and edit/delete) a user programmatically from a java EE app?

From: Manfred Riem <mriem_at_manorrock.org>
Date: Wed, 6 Aug 2008 06:13:30 -0600

If you would use the JDBC realm you have can access the same
database the realm uses from within your application.

Manfred

-----Original Message-----
From: glassfish_at_javadesktop.org [mailto:glassfish_at_javadesktop.org]
Sent: Tuesday, August 05, 2008 11:31 PM
To: users_at_glassfish.dev.java.net
Subject: How do I add (and edit/delete) a user programmatically from a java EE app?

Hi,

This is probably a newbie question, but I have searched everywhere for the answer and I cannot find it.

I need to be able to add new users (with roles) to the realm (currently using the default file realm) from within admin pages of my own Java Server Faces application (not the admin pages of the server itself). Ideally this would be done in EJB's that are called by the JSF managed beans.

So for example, a super user (for example a client of a company with a web service), needs to be able to add a new user (customer of the client) from special JSF pages (that normal (customer) users cannot access).

How do I do this? I know how to add users to the realm using the admin pages of the server, but I need to do it from within my program.

Specifically I'm using JSF pages and EJB's running under glassfish (actually Sun Java Application Server 9.1) using the default file realm. But I would like to do this in a generic way that works on all complaint Java EE containers and all types of realms. But if I can't get that I'll settle for a subset. If I need to change to a different realm, different type of realm, or some sort of custom security/login, I am willing to do that.

Thanks,
Mark
[Message sent by forum member 'markkr2' (markkr2)]

http://forums.java.net/jive/thread.jspa?messageID=291764

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net