Skip to main content

Is there a way to get the list of users registered in admin-realm

2 replies [Last post]
joshna161619
Offline
Joined: 2006-10-19

Hi

I have created few users in the admin-realm of my glassfish installation.

Is there a way to get the list of these users to show in my jsf based portlet application.

Please give me the pointers if any api is available

Thanks
K.Joshna

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
km
Offline
Joined: 2005-10-28

Absolutely.

See [b]asadmin list-file-users[/b], assuming you are using the file-realm.

How did I find it out?

Kudos to <a href="http://blogs.sun.com/janeyoung/entry/finding_cli_commands_in_glassfish">Jane Young<a> who implemented this feature. -- here is what I did:

C:\gf\publish\glassfish\bin>.\asadmin users
Unable to find entry for command, users.
Closest matching command(s):
list-file-users
CLI001 Invalid Command, users.

--- I didn't know anything about the exact name of this command. So, I started with "users" and bingo! I got the command. Just use --authrealmname admin-realm on the
invocation.

Hope this helps.

Regards,
Kedar

joshna161619
Offline
Joined: 2006-10-19

What you have mentioned is the cli command.

But I need to get the list of Users in my java code.Is there any api which glassfish exposes to get the admin-related information..

Heard about glassfish Mbeans.So can I use them to get the registered users list.If so can somebody expain me the procedure to do it.

Thanks
Joshna