Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. ###################################################################
  2.  
  3. #
  4.  
  5. # @author Copyright (c) 2010 - 2011 by Middleware Magic, All Rights Reserved.
  6.  
  7. #
  8.  
  9. #############################################################################
  10.  
  11.  
  12.  
  13. from java.io import FileInputStream
  14.  
  15. from weblogic.management.security.authentication import UserReaderMBean
  16.  
  17.  
  18.  
  19. propInputStream = FileInputStream("details.properties")
  20.  
  21. configProps = Properties()
  22.  
  23. configProps.load(propInputStream)
  24.  
  25.  
  26.  
  27. adminURL=configProps.get("admin.url")
  28.  
  29. adminUserName=configProps.get("admin.userName")
  30.  
  31. adminPassword=configProps.get("admin.password")
  32.  
  33. userNameWildcard=configProps.get("user.name.wildcard")
  34.  
  35. maximumToReturn=configProps.get("maximum.to.return")
  36.  
  37. showAllAuthenticatorUserList=configProps.get("show.all.authenticator.userlist")
  38.  
  39.  
  40.  
  41. connect(adminUserName, adminPassword, adminURL)
  42.  
  43.  
  44.  
  45. realmName=cmo.getSecurityConfiguration().getDefaultRealm()
  46.  
  47. authProvider = realmName.getAuthenticationProviders()
  48.  
  49.  
  50.  
  51. for i in authProvider:
  52.  
  53.     if isinstance(i,UserReaderMBean):
  54.  
  55.         userName = i
  56.  
  57.         authName= i.getName()
  58.  
  59.  
  60.  
  61.         if showAllAuthenticatorUserList == 'true':
  62.  
  63.             userList = i.listUsers(str(userNameWildcard),int(maximumToReturn))
  64.  
  65.             print '======================================================================'
  66.  
  67.             print 'Below are the List of USERS which are in the: "'+authName+'"'
  68.  
  69.             print '======================================================================'
  70.  
  71.             num=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement