Authentication with default login modules

The e!DAL system need a Subject to authenticate the user.
The EdalHelpers class provides some static methods to use some default login modules.

/* use Windows or Unix or MAC login module */
	
	Subject mySubject = EdalHelpers.authenticateWinOrUnixOrMacUser();

/* use Sample login module */
	
	Subject mySubject = EdalHelpers.authenticateSampleUser();

/* use Kerberos login module with IPK realm and kdc */
	
	Subject mySubject = EdalHelpers.authenticateIPKKerberosUser("username");

/* use Google+ login module */
	
	Subject mySubject = EdalHelpers.authenticateNewGoogleUser("httpProxyHost", httpProxyPort);

/* use ORCID login module */
	
	Subject mySubject = EdalHelpers.authenticateORCIDUser("httpProxyHost", httpProxyPort);
					

Authentication with new login modules

Alternatively you can use your own login modules.
For this the EdalHelpers class provides two static methods:

/* use own login module */
	
    Subject mySubject = EdalHelpers.authenticateSubject("LoginModules.properties","MyLoginModul");

/* use own login module and callbackhandler */
	
    Subject mySubject = EdalHelpers.authenticateSubject("LoginModules.properties","MyLoginModul", new CallbackHandler());
					
The login configuration file for the login modules look like this:

// for Windows-NTLoginModule:
Windows{ com.sun.security.auth.module.NTLoginModule required; };
 
// for Unix-LoginModule:
Unix{ com.sun.security.auth.module.UnixLoginModule required; };

Authentication with Kerberos

To use your own Kerberos parameter the EdalHelpers class provide the authenticateSubjectWithKerberos() method:

/* use own Kerberos properties with given realm and kdc*/

	Subject mySubject = EdalHelpers.authenticateSubjectWithKerberos("realm","kdc","username");
					
The Kerberos configuration file look like this:

realm = MYDOMAIN.COM
kdc = authentication-server.mydomain.com
For more information about the login configuration and how to write a login module refer to JAAS documentation