Author: prabath
Date: Thu Mar 13 20:29:24 2008
New Revision: 14787

Log:

fixed the issue associated with when query string exceeds the limits in a GET 
request and PAPE related fixes

Added:
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDRedirectAction.java
   
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidredirect.jsp
   trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/redirect.jsp
Modified:
   
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
   
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
   trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
   
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidauthentication.jsp

Modified: 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
==============================================================================
--- 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
     (original)
+++ 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
     Thu Mar 13 20:29:24 2008
@@ -2,6 +2,7 @@
 
 import java.io.IOException;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -101,7 +102,7 @@
 
             } else if (IdentityConstants.OpenId.CHECKID_SETUP.equals(mode)
                     || 
IdentityConstants.OpenId.CHECKID_IMMEDIATE.equals(mode)) {
-                return checkSetupOrImmediate(httpReq, request);
+                return checkSetupOrImmediate(httpReq, httpResp, request);
             } else if (IdentityConstants.OpenId.CHECK_AUTHENTICATION
                     .equals(mode)) {
                 responseText = checkAuthentication(request);
@@ -180,8 +181,9 @@
      * @throws AssociationException
      */
     private String checkSetupOrImmediate(HttpServletRequest httpReq,
-            ParameterList params) throws IdentityProviderException,
-            ServerException, MessageException, AssociationException {
+            HttpServletResponse httpResp, ParameterList params)
+            throws IdentityProviderException, ServerException,
+            MessageException, AssociationException {
 
         boolean authenticatedAndApproved = false;
         String userSelectedClaimedId = null;
@@ -278,7 +280,30 @@
                 }
             }
 
-            return message.getDestinationUrl(false);
+            sendData(httpReq, httpResp, message);
+            return null;
+        }
+    }
+
+    /**
+     * @param message
+     */
+    private void sendData(HttpServletRequest httpReq,
+            HttpServletResponse httpResp, Message message) {
+
+        try {
+            String page = null;
+
+            page = "/jsp/redirect.jsp";
+
+            // HTML FORM Redirection
+            RequestDispatcher dispatcher = httpReq.getRequestDispatcher(page);
+            httpReq.setAttribute("prameterMap", message.getParameterMap());
+            httpReq.setAttribute("destinationUrl", message
+                    .getDestinationUrl(false));
+            dispatcher.forward(httpReq, httpResp);
+
+        } catch (Exception e) {
         }
     }
 

Modified: 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
==============================================================================
--- 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
      (original)
+++ 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
      Thu Mar 13 20:29:24 2008
@@ -50,12 +50,12 @@
                 papeResponse = PapeResponse.createPapeResponse();
                 if (request.isPhishingResistanceLogin()) {
                     papeResponse
-                            
.setAuthPolicies(PapeMessage.PAPE_POLICY_PHISHING_RESISTANT);
+                            
.addAuthPolicy(PapeMessage.PAPE_POLICY_PHISHING_RESISTANT);
                     papeResponse.setNistAuthLevel(1);
                 }
                 if (request.isMultifactorLogin()) {
                     papeResponse
-                            
.setAuthPolicies(PapeMessage.PAPE_POLICY_MULTI_FACTOR);
+                            
.addAuthPolicy(PapeMessage.PAPE_POLICY_MULTI_FACTOR);
                     papeResponse.setNistAuthLevel(2);
                 }
             }

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
 (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/UIConstants.java
 Thu Mar 13 20:29:24 2008
@@ -56,6 +56,8 @@
     public final static String OPENID_SERVER_PAGE = "/server";
 
     public final static String OPENID_USER_PAGE = "/user";
+    
+    public final static String OPENID_REDIRECT = "/redirect.jsp";    
 
     public final static String OPENID_AUTH_ACTION = 
"OpenIDAuthentication.action";
 
@@ -79,6 +81,7 @@
 
     public final static String EDIT_USER_PROFILE_ACTION = 
"EditUserProfile.action";
     
-    public final static String EDIT_USER_PROFILE_SUBMIT_ACTION = 
"EditUserProfileSubmit.action";   
-
+    public final static String EDIT_USER_PROFILE_SUBMIT_ACTION = 
"EditUserProfileSubmit.action"; 
+    
+    public final static String OPENID_REDIRECT_ACTION="OpenIDRedirect.action";
 }

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
 (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
 Thu Mar 13 20:29:24 2008
@@ -102,6 +102,7 @@
                                     .setAttribute(
                                             
"multiFactorAuthenticationWithUsernamePassword",
                                             "true");
+                            session.setAttribute("multifactorlogin", "true");
                             
response.sendRedirect("OpenIDAuthentication.action");
                             break;
                         }

Added: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDRedirectAction.java
==============================================================================
--- (empty file)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDRedirectAction.java
 Thu Mar 13 20:29:24 2008
@@ -0,0 +1,19 @@
+package org.wso2.solutions.identity.user.ui.action;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class OpenIDRedirectAction extends ActionSupport {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -1951830854960371602L;
+
+    /**
+     * This will get executed during OpenID login
+     */
+    public String execute() throws Exception {
+        return SUCCESS;
+    }
+
+}

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
      (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
      Thu Mar 13 20:29:24 2008
@@ -69,6 +69,7 @@
                         .indexOf(UIConstants.OPENID_AUTH_VERIFICATION_ACTION) 
< 0
                 && requestURL.indexOf(UIConstants.OPENID_USER_APPROVAL_ACTION) 
< 0
                 && 
requestURL.indexOf(UIConstants.UPDATE_OPENID_USER_RP_ACTION) < 0
+                && requestURL.indexOf(UIConstants.OPENID_REDIRECT_ACTION) < 0
                 && requestURL.toString().indexOf(
                         UIConstants.OPENID_LOGIN_ACTION) < 0) {
             // If the request is not Login.action

Modified: trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
==============================================================================
--- trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml      
(original)
+++ trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml      
Thu Mar 13 20:29:24 2008
@@ -225,5 +225,10 @@
             <result name="error" 
type="redirect">EditUserProfile.action</result>
         </action>
         
+          <action name="OpenIDRedirect" 
class="org.wso2.solutions.identity.user.ui.action.OpenIDRedirectAction">
+                       <result name="success">/jsp/openidredirect.jsp</result>
+                        <result name="error" 
type="redirect">Login.action</result>
+               </action>
+        
     </package>
 </struts>
\ No newline at end of file

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidauthentication.jsp
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidauthentication.jsp
       (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidauthentication.jsp
       Thu Mar 13 20:29:24 2008
@@ -84,7 +84,7 @@
                                                <s:if 
test="%{multiFactorPhysicalAuthentication}">
                                                        <tr>
                                                                
<td><strong>Sorry, we do not support
-                                                               
Multi-Factor/Multi-Factor-Physical Authentication</strong></td>
+                                                               
Multi-Factor-Physical Authentication</strong></td>
                                                        </tr>
                                                </s:if>
                                        </table>

Added: 
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidredirect.jsp
==============================================================================
--- (empty file)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidredirect.jsp 
    Thu Mar 13 20:29:24 2008
@@ -0,0 +1,17 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+       pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<title>OpenID HTML FORM Redirection</title>
+</head>
+<body onload="document.forms['openid-form-redirection'].submit();">
+<form name="openid-form-redirection"
+       action="<s:property value="destinationUrl"/>" method="post"
+       accept-charset="utf-8"><s:iterator value="parameterMap">
+       <input type="hidden" name="<s:property value="key" />"
+               value="<s:property value="value" />" />
+</s:iterator>
+<button type="submit">Continue...</button>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/redirect.jsp
==============================================================================
--- (empty file)
+++ trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/redirect.jsp   
Thu Mar 13 20:29:24 2008
@@ -0,0 +1,12 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+    pageEncoding="ISO-8859-1"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Insert title here</title>
+</head>
+<body>
+<%response.sendRedirect("OpenIDRedirect.action"); %>
+</body>
+</html>
\ No newline at end of file

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

Reply via email to