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
Thanks
PEter
I am using weblogic 7.0.
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.