Java Reference
In-Depth Information
Policy —he java.security.Policy class is an abstract class in the JAAS module for
representing the system-wide “access control policy.” Based on the application requirement,
developers need to extend this class for appropriate implementation, based on the security
needs of application. Sun Microsystems packs the software development kit of Java SE with
a sample ile-based subclass implementation of policy abstract class, to support principal-
based “grant” entries in the “policy iles.”
AuthPermission —he javax.security.auth.AuthPermission class essentially
encapsulates the basic “permissions” required for JAAS. An AuthPermission object
contains a name but no actions list; you either have the named permission or you don't.
PrivateCredentialPermission —he javax.security.auth.PrivateCredentialPer-
mission class protects access to a subject's private credentials.
7.4.4 Process of Authentication
he process of authentication of a subject involves the following steps:
An application instantiates a
LoginContext object.
LoginContext o b j e c t c o n s u l t s a c o n i g u r a t i o n o b j e c t t o l o a d a l l o f t h e LoginModules
conigured for the given application.
Next, the application invokes the
he
LoginContext 's login method.
he login method now invokes all of the loaded
LoginModules . Each LoginModule
attempts to authenticate the subject. Upon successful authentication, LoginModules asso-
ciate relevant principals and credentials with a subject object that represents the subject being
authenticated.
he
LoginContext then returns the authentication status of the subject to the
application.
If authentication succeeds, the application retrieves the subject from the
LoginContext .
7.4.5 Process of Authorization
To make authorization take place in an appropriate manner, the following needs to be ensured:
he subject must be authenticated, as described in the
LoginContext section described
earlier.
he subject that is the result of authentication must then be associated with an access control
context, as described in the subject section.
Principal-based entries must be conigured in the security policy.
Once the subject has been authenticated, it needs to access the policy ile to perform authoriza-
tion or permission checks. he way the subject gets authorization three simple steps:
he subject is acquired from the LoginContext after a successful login.
he subject uses the static method called doAsPrivileged to execute a protected block of code
on behalf of the subject.
he subject uses block of code is implemented by a PrivilegedAction implementation.
Search WWH ::




Custom Search