Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to Accessing user and groups

0 views
Skip to first unread message

Peter Sands

unread,
Sep 15, 2003, 5:34:56 PM9/15/03
to

Greetings to All
I am trying to access user and groups list from the embedded LDAP in BEA. Get
the following error.
weblogic.management.NoAccessRuntimeException: Access not allowed for subject:
pr
incipals=[], on ResourceType: Security:Name=myrealmDefaultAuthenticator Action:
execute, Target: listGroups

Start server side stack trace:
weblogic.management.NoAccessRuntimeException: Access not allowed for subject:
pr
incipals=[], on ResourceType: Security:Name=myrealmDefaultAuthenticator Action:
execute, Target: listGroups
at weblogic.management.internal.Helper$IsAccessAllowedPrivilegeAction.ru
n(Helper.java:2144)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:685)
at weblogic.management.internal.Helper.isAccessAllowed(Helper.java:1956)

etc...

I am using the following code in a Java bean to get the list. If I execute this
code as a standalone program it works. I can get the user list, but if I call
this from a JSP I get the NoAccessRuntimeException error even I hard code the
system and weblogic id

adminHome = (MBeanHome) Helper.getAdminMBeanHome ("system","weblogic",url);

AuthenticationProviderMBean[] providers = adminHome.getActiveDomain().getSecurityConfiguration().findDefaultRealm().getAuthenticationProviders();
System.out.println(" List of Users ");

for (int i=0; providers != null && i <providers.length; i++) {
if (providers[i] instanceof UserReaderMBean) {
UserReaderMBean editor = (UserReaderMBean) providers[i];
try {
String cursor = editor.listUsers("*",100);
while (editor.haveCurrent(cursor)) {
// System.err.println(editor.getCurrentName(cursor));
editor.advance (cursor);
} // while

} catch (Exception e) {
e.printStackTrace();
} // try-catch
} // if
} // for


All suggestionsand solutions are welcome

Peter

Jay Zimmett

unread,
Sep 15, 2003, 6:50:12 PM9/15/03
to
You may want to use the com.bea.p13n.usermgmt EJB. See the getUserNames
method.

Peter

unread,
Sep 16, 2003, 8:36:28 AM9/16/03
to

Thanks Jay,
com.bea.p13n.usermgmt EJB is part of WLS 8.0
But I would certainly would like to see more of this EJB code. If you have can
u post it.

Thanks
PEter

I am using weblogic 7.0.

Peter

unread,
Sep 18, 2003, 10:22:32 PM9/18/03
to

"Peter Sands" <peter...@hotmail.com> wrote in message
news:3f663080$1...@newsgroups.bea.com...

In the jsp, login using an admin username/password. Then using the subject,
do a runas
that calls the listgroups method. In 8.1, commo mbean access requires admin
role.


0 new messages