13.07.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Method signatureResult getUsersForGroup(Stringgroup<strong>Security</strong>Name, int limit) throwsNotImplementedException,EntryNotFoundException,CustomRegistryException,RemoteExceptionpublic List getGroupsForUser(Stringuser<strong>Security</strong>Name) throwsEntryNotFoundException,CustomRegistryException,RemoteExceptionCredential createCredential(Stringuser<strong>Security</strong>Name) throwsNotImplementedException,EntryNotFoundException,CustomRegistryException,RemoteExceptionUseGets a list of users in a group. Themaximum number of users returned isdefined by the limit argument.Gets all the groups the given user is amember of.Throws the NotImplementedException forthis method.Sample custom registryThe following section documents the implementation of a DB2 custom registry.The DB2 registry uses JDBC to communicate with the database. Although thisregistry was tested with DB2, it should be possible to modify it to work with otherrelational databases. The source code (DB2Registry.java) is shown below and isalso included in the ITSOBank application, along with the database structure.Open the DB2Registry.java source in <strong>WebSphere</strong> Studio and check thecomments in the source code. You will find all the required methods for theUserRegistry interface implemented. Look for the SQL queries in the code andsee what each method does with the database,The DB2Registry.class file must be copied to a directory accessible by theapplication server, that is a directory that is in the application server’s classpath(for example, /lib). Alternatively, update the applicationserver’s classpath to refer to the directory that contains the class file.A simple custom registry test utility that runs from the command line is includedand can be used to test whether the custom registry is working as required. Thetool allows the developer to be sure that the custom registry is functioning beforeconfiguring the application server to use it. The tool will ask for some user andgroup information and use this information to query the custom registry. It willChapter 8. Programmatic security 189

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!