no.feide.mellon.jaas.loginutility
Class Login

java.lang.Object
  extended by no.feide.mellon.jaas.loginutility.Login

public class Login
extends java.lang.Object

This class authenticates a Subject and then executes a specified application as that Subject. To use this class, the java interpreter would typically be invoked as:

    % java -Djava.security.manager \
        Login \
         
 

applicationClass represents the application to be executed as the authenticated Subject, and applicationClass_args are passed as arguments to applicationClass.

To perform the authentication, Login uses a LoginContext. A LoginContext relies on a Configuration to determine the modules that should be used to perform the actual authentication. The location of the Configuration is dependent upon each Configuration implementation. The default Configuration implementation (com.sun.security.auth.login.ConfigFile) allows the Configuration location to be specified (among other ways) via the java.security.auth.login.config system property. Therefore, the Login class can also be invoked as:

    % java -Djava.security.manager \
        -Djava.security.auth.login.config= \
        Login \
         
 


Constructor Summary
Login()
           
 
Method Summary
static void main(java.lang.String[] args)
           Instantate a LoginContext using the provided application classname as the index for the login Configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Login

public Login()
Method Detail

main

public static void main(java.lang.String[] args)

Instantate a LoginContext using the provided application classname as the index for the login Configuration. Authenticate the Subject (three retries are allowed) and invoke Subject.doAsPrivileged with the authenticated Subject and a PrivilegedExceptionAction. The PrivilegedExceptionAction loads the provided application class, and then invokes its public static main method, passing it the application arguments.

Parameters:
args - the arguments for Login. The first argument must be the class name of the application to be invoked once authentication has completed, and the subsequent arguments are the arguments to be passed to that application's public static main method.


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.