Allow X509Authentication to be triggered from Login Choices page as well. Default is old behavior, This allows one to maintain the site under http and only protect certificate login page with https for certificate authentication. Implicit X509 Authentication is not ideal in relation to default Internet Explorer behavior.

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@2435 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2007-12-13 19:26:33 +00:00
parent 7bd52205f6
commit f7f8500155
5 changed files with 152 additions and 6 deletions

View File

@@ -110,6 +110,10 @@ public class X509Authentication
/** key store for CA certs if we use that */
private static KeyStore caCertKeyStore = null;
private static String loginPageTitle = null;
private static String loginPageURL = null;
/**
* Initialization:
* Set caPublicKey and/or keystore. This loads the information
@@ -117,6 +121,14 @@ public class X509Authentication
*/
static
{
/*
* allow identification of alternative entry points
* for certificate authentication when
* selected by the user rather than implicitly.
*/
loginPageTitle = ConfigurationManager.getProperty("authentication.x509.chooser.title.key");
loginPageURL = ConfigurationManager.getProperty("authentication.x509.chooser.uri");
String keystorePath = ConfigurationManager.getProperty("authentication.x509.keystore.path");
String keystorePassword = ConfigurationManager.getProperty("authentication.x509.keystore.password");
String caCertPath = ConfigurationManager.getProperty("authentication.x509.ca.cert");
@@ -457,10 +469,10 @@ public class X509Authentication
}
/**
* Return null, since this is an implicit method with no login page.
* Returns URL of password-login servlet.
*
* @param context
* DSpace context, will be modified (ePerson set) upon success.
* DSpace context, will be modified (EPerson set) upon success.
*
* @param request
* The HTTP request that started this operation, or null if not applicable.
@@ -474,19 +486,20 @@ public class X509Authentication
HttpServletRequest request,
HttpServletResponse response)
{
return null;
return loginPageURL;
}
/**
* Return null, since this is an implicit method with no login page.
* Returns message key for title of the "login" page, to use
* in a menu showing the choice of multiple login methods.
*
* @param context
* DSpace context, will be modified (ePerson set) upon success.
* DSpace context, will be modified (EPerson set) upon success.
*
* @return Message key to look up in i18n message catalog.
*/
public String loginPageTitle(Context context)
{
return null;
return loginPageTitle;
}
}