Expose servlet init property to enable storing of password in Subject private credent...
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 7 May 2009 15:19:51 +0000 (15:19 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 7 May 2009 15:19:51 +0000 (15:19 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2846 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/main/java/edu/internet2/middleware/shibboleth/idp/authn/provider/UsernamePasswordLoginServlet.java

index 03bb560..48a8fbb 100644 (file)
@@ -72,6 +72,9 @@ public class UsernamePasswordLoginServlet extends HttpServlet {
 
     /** Parameter name to indicate login failure. */
     private final String failureParam = "loginFailed";
+    
+    /** Parameter name to indicate the login credentials should be stored in the Subject private credential set. */
+    private final String storeCredentials = "storeCredentialsInSubject";
 
     /** HTTP request parameter containing the user name. */
     private final String usernameAttribute = "j_username";
@@ -93,6 +96,10 @@ public class UsernamePasswordLoginServlet extends HttpServlet {
         if(!loginPage.startsWith("/")){
             loginPage = "/" + loginPage;
         }
+        
+        if(getInitParameter(storeCredentials) != null){
+            storeCredentialsInSubject = Boolean.parseBoolean(getInitParameter(storeCredentials));
+        }
     }
 
     /** {@inheritDoc} */