[jboss-cvs] Picketlink SVN: r677 - federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 27 13:02:03 EST 2011


Author: anil.saldhana at jboss.com
Date: 2011-01-27 13:02:02 -0500 (Thu, 27 Jan 2011)
New Revision: 677

Modified:
   federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
Log:
PLFED-129: make STSClient configurable and make private instance var protected

Modified: federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
===================================================================
--- federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java	2011-01-27 17:48:37 UTC (rev 676)
+++ federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java	2011-01-27 18:02:02 UTC (rev 677)
@@ -77,6 +77,9 @@
  * specify the username and password that are to be used by the application server to authenticate to the STS and
  * have the SAML assertions validated.
  * </p>
+ * <p>
+ * <b>NOTE:</b> Sub-classes can use {@link #getSTSClient()} method to customize the {@link STSClient} class to make calls to STS/
+ * </p>
  * 
  * @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
  */
@@ -84,13 +87,13 @@
 public class SAML2STSLoginModule extends AbstractServerLoginModule
 {
 
-   private String stsConfigurationFile;
+   protected String stsConfigurationFile;
 
-   private Principal principal;
+   protected Principal principal;
 
-   private SamlCredential credential;
+   protected SamlCredential credential;
 
-   private AssertionType assertion;
+   protected AssertionType assertion;
 
    /*
     * (non-Javadoc)
@@ -160,9 +163,8 @@
          throw exception;
       }
 
-      // send the assertion to the STS for validation.
-      Builder builder = new Builder(this.stsConfigurationFile);
-      STSClient client = new STSClient(builder.build());
+      // send the assertion to the STS for validation. 
+      STSClient client = this.getSTSClient() ;
       try
       {
          boolean isValid = client.validateToken(assertionElement);
@@ -299,4 +301,14 @@
       }
       return null;
    }
+   
+   /**
+    * Get the {@link STSClient} object with which we can make calls to the STS
+    * @return
+    */
+   protected STSClient getSTSClient()
+   {
+      Builder builder = new Builder(this.stsConfigurationFile);
+      return new STSClient(builder.build());
+   }
 }
\ No newline at end of file



More information about the jboss-cvs-commits mailing list