03.05.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Example 8-5 login.config<br />

WSLogin {<br />

com.ibm.ws.security.common.auth.module.proxy.WSLoginModuleProxy required<br />

delegate=com.ibm.ws.security.common.auth.module.WSLoginModuleImpl;<br />

};<br />

The configuration file can have multiple definitions, each definition has an alias<br />

name, which can be used in the application to set the login module. The entry<br />

defines the Java class for the login module; the "required" means that this class's<br />

approval is necessary for login to succeed. The entry can optionally define a<br />

delegation class for the login module.<br />

There can be a policy file for JAAS defined, similar to the policy files used in Java<br />

2 security. Actually, the Java 2 <strong>Security</strong> and JAAS policy files may be merged in<br />

the next release of Java, in J2EE V1.4. This policy file is optional.<br />

Example 8-6 jaas.policy<br />

grant Principal SamplePrincipal "user01" {<br />

permission java.util.PropertyPermission<br />

"user.home", "read";<br />

};<br />

The policy file defines the access policy for the resources in an application. The<br />

policy defines the principal for the resources.<br />

8.7 Programmatic login<br />

When you want to implement your own login mechanism for your application, you<br />

may want to use JAAS and implement the required programmatic login.<br />

Figure 8-8 shows the activity diagram for JAAS and how the different<br />

components are working together during a login process.<br />

Chapter 8. Programmatic security 207

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

Saved successfully!

Ooh no, something went wrong!