Author: prabath
Date: Wed Jan 23 22:23:08 2008
New Revision: 12804

Log:

added OpenID processing logic

Modified:
   
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/servletfilter/RelyingPartyFilter.java

Modified: 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/servletfilter/RelyingPartyFilter.java
==============================================================================
--- 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/servletfilter/RelyingPartyFilter.java
   (original)
+++ 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/servletfilter/RelyingPartyFilter.java
   Wed Jan 23 22:23:08 2008
@@ -53,7 +53,6 @@
 import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.components.crypto.X509NameTokenizer;
 import org.apache.ws.security.util.DOM2Writer;
-import org.openid4java.infocard.OpenIDToken;
 import org.w3c.dom.Element;
 import org.wso2.solutions.identity.IdentityConstants;
 import org.wso2.solutions.identity.openid.relyingparty.OpenIDConsumer;
@@ -110,6 +109,16 @@
 
             String infoCardSignin = request.getParameter("InfoCardSignin");
 
+            boolean isOpenIDSignin = false;
+
+            isOpenIDSignin = OpenIDConsumer
+                    .isOpenIDAuthetication((HttpServletRequest) request);
+
+            if (isOpenIDSignin) {
+                OpenIDConsumer.getInstance().setSessionAttributes(
+                        (HttpServletRequest) request);
+            }
+
             if (log.isDebugEnabled()) {
                 log.debug("InfoCardSignin : " + infoCardSignin);
             }
@@ -125,7 +134,13 @@
                 boolean isOpenIDInfoCardToken = OpenIDConsumer
                         .isOpenIDInfoCardToken(xmlToken);
 
-                // We want to treat the decryption of OpenIDInfoCard token 
differently.
+                if (isOpenIDInfoCardToken) {
+                    // We want to treat the decryption of OpenIDInfoCard token
+                    // differently.
+                    OpenIDConsumer.getInstance().setInfocardSessionAttributes(
+                            (HttpServletRequest) request);
+                }
+
                 if (xmlToken != null && !isOpenIDInfoCardToken) {
 
                     TokenVerifier verifier = new TokenVerifier();
@@ -184,7 +199,7 @@
                 validated = true;
             }
         } else if (issuerPolicy.equals(TokenVerifierConstants.SELF_ONLY)) {
-            //not a self issued card when self only
+            // not a self issued card when self only
             validated = false;
         } else if (validatePolicy.equals(TokenVerifierConstants.PROMISCUOUS)) {
             validated = true;
@@ -359,7 +374,7 @@
                 
.getInitParameter(TokenVerifierConstants.TOKEN_VALIDATE_POLICY);
 
         if (validatePolicy == null) {
-            validatePolicy = TokenVerifierConstants.CERT_VALIDATE; 
//.PROMISCUOUS;
+            validatePolicy = TokenVerifierConstants.CERT_VALIDATE; // 
.PROMISCUOUS;
         }
 
         // Step 3: Reading paramters of each policy

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to