Author: prabath
Date: Wed Apr  2 13:33:01 2008
New Revision: 15500

Log:

Displaying attribute values to the user from the selected profile once data 
being submitted to the RP

Modified:
   
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
   
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDAttributeExchange.java
   
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDExtension.java
   
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
   
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDSimpleReg.java
   
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
   
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidapproval.jsp

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
   (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProvider.java
   Wed Apr  2 13:33:01 2008
@@ -17,6 +17,8 @@
 package org.wso2.solutions.identity.openid;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletOutputStream;
@@ -238,19 +240,25 @@
             authenticatedAndApproved = true;
         }
 
+        // Process an authentication request.
+        AuthRequest authReq = AuthRequest.createAuthRequest(params, manager
+                .getRealmVerifier());
+
+        List<String> requestedAttributes = null;
+
         if (IdentityConstants.OpenId.CANCEL.equals(httpReq
                 .getParameter(IdentityConstants.OpenId.ACTION))) {
             authenticatedAndApproved = false;
         } else if (!authenticatedAndApproved) {
             // Not authenticated, redirect to the authentication
             // page.
+            requestedAttributes = getRequestedAttributes(authReq);
             session.setAttribute(IdentityConstants.OpenId.PARAM_LIST, params);
+            session.setAttribute("RequestedAttr", requestedAttributes);
             return authPage;
         }
 
-        // Process an authentication request.
-        AuthRequest authReq = AuthRequest.createAuthRequest(params, manager
-                .getRealmVerifier());
+        session.removeAttribute("RequestedAttr");
 
         String opLocalId = null;
 
@@ -309,6 +317,28 @@
         }
     }
 
+    private List<String> getRequestedAttributes(AuthRequest request)
+            throws IdentityProviderException {
+
+        OpenIDAuthenticationRequest req = null;
+        OpenIDExtension extension = null;
+        List<String> requiredAttributes = null;
+
+        req = new OpenIDAuthenticationRequest();
+        req.setAuthRequest(request);
+        requiredAttributes = new ArrayList<String>();
+
+        for (Object alias : request.getExtensions()) {
+            req.setExtensionAlias((String) alias);
+            extension = OpenIDExtensionFactory.getInstance().getExtension(req);
+            if (extension != null) {
+                extension.addRequiredAttributes(requiredAttributes);
+            }
+        }
+
+        return requiredAttributes;
+    }
+
     /**
      * @param message
      */

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDAttributeExchange.java
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDAttributeExchange.java
       (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDAttributeExchange.java
       Wed Apr  2 13:33:01 2008
@@ -18,6 +18,7 @@
 
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -52,6 +53,84 @@
         this.request = request;
     }
 
+    public void addRequiredAttributes(List<String> requiredAttributes)
+            throws IdentityProviderException {
+
+        MessageExtension extensions = null;
+        AuthRequest authRequest = null;
+
+        try {
+            authRequest = request.getAuthRequest();
+            extensions = authRequest.getExtension(FetchRequest.OPENID_NS_AX);
+
+            if (extensions instanceof FetchRequest) {
+                Map required = null;
+                Map optional = null;
+                FetchRequest fetchRequest = null;
+
+                fetchRequest = (FetchRequest) extensions;
+
+                // Get the required attributes as requested by the
+                // RP.
+                required = fetchRequest.getAttributes(true);
+                optional = fetchRequest.getAttributes();
+
+                if (optional != null && !optional.isEmpty()) {
+                    Iterator iterator = optional.entrySet().iterator();
+                    Entry entry = null;
+                    while (iterator.hasNext()) {
+                        entry = (Entry) iterator.next();
+                        if (!required.containsKey(entry.getKey())) {
+                            required.put(entry.getKey(), entry.getValue());
+                        }
+                    }
+                }
+
+                Map<String, ClaimDO> claims = null;
+                ClaimDO[] supportedClaims = null;
+                ClaimsAdmin claimsAdmin = null;
+                Iterator<Entry<String, String>> iterator = null;
+                Map<String, String> map = null;
+                Entry<String, String> entry = null;
+
+                claims = new HashMap<String, ClaimDO>();
+
+                claimsAdmin = new ClaimsAdmin();
+                supportedClaims = claimsAdmin.getAllMappedEnabledClaims();
+
+                for (int i = 0; i < supportedClaims.length; i++) {
+                    ClaimDO temp = supportedClaims[i];
+                    if (temp.getOpenIDTag() != null) {
+                        claims.put(temp.getOpenIDTag(), temp);
+                    }
+                }
+
+                iterator = required.entrySet().iterator();
+                map = new HashMap<String, String>();
+
+                String val = null;
+                String tag = null;
+
+                while (iterator.hasNext()) {
+                    entry = iterator.next();
+                    val = getMappedAxSchema((String) entry.getValue());
+                    tag = claimsAdmin.getMappedOpenIDTag(val);
+                    if (tag != null) {
+                        claims.get(tag).setUri((String) entry.getValue());
+                        map.put(tag, (String) entry.getKey());
+                    }
+                }
+
+                mapToAttriId(map.keySet(), requiredAttributes, claims);
+            }
+
+        } catch (MessageException ex) {
+            throw new IdentityProviderException(
+                    IdentityConstants.ErrorCodes.OPENID_RESP_GENERATION_FAILED,
+                    ex);
+        }
+    }
+
     /**
      * Creates an instance of MessageExtension for the OpenID authentication
      * response

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDExtension.java
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDExtension.java
       (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDExtension.java
       Wed Apr  2 13:33:01 2008
@@ -1,17 +1,12 @@
 /*
- * Copyright 2005-2008 WSO2, Inc. (http://wso2.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2005-2008 WSO2, Inc. (http://wso2.com) Licensed under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 
 package org.wso2.solutions.identity.openid.extensions;
@@ -43,6 +38,37 @@
             String profileName) throws IdentityProviderException;
 
     /**
+     * 
+     * @param requiredAttributes
+     * @throws IdentityProviderException
+     */
+    public abstract void addRequiredAttributes(List<String> requiredAttributes)
+            throws IdentityProviderException;
+
+    protected void mapToAttriId(Collection<String> requiredClaims,
+            List<String> requiredAttributes, Map<String, ClaimDO> claims) {
+
+        Iterator<String> iterator = null;
+        // Get the column names for the URIs
+        iterator = requiredClaims.iterator();
+
+        String tag = null;
+        ClaimDO claim = null;
+
+        // First we need to figure-out which attributes we need to retrieve 
from
+        // the user store.
+        while (iterator.hasNext()) {
+            tag = (String) iterator.next();
+            claim = (ClaimDO) claims.get(tag);
+            if (claim != null
+                    && !claim.getUri().equals(IdentityConstants.CLAIM_PPID)) {
+                if (claim.isSupported())
+                    requiredAttributes.add(claim.getAttrId());
+            }
+        }
+    }
+
+    /**
      * Populate the required claims with claim values.
      * @param requiredClaims Required claims as requested by the RP.
      * @param userId User ID.
@@ -72,7 +98,7 @@
         String tag = null;
         ClaimDO claim = null;
 
-        // First we need to figure-out which attributed we need to retrieve 
from
+        // First we need to figure-out which attributes we need to retrieve 
from
         // the user store.
         while (iterator.hasNext()) {
             tag = (String) iterator.next();

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
    (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDPape.java
    Wed Apr  2 13:33:01 2008
@@ -1,17 +1,12 @@
 /*
- * Copyright 2005-2008 WSO2, Inc. (http://wso2.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2005-2008 WSO2, Inc. (http://wso2.com) Licensed under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 
 package org.wso2.solutions.identity.openid.extensions;
@@ -44,6 +39,11 @@
         this.request = request;
     }
 
+    public void addRequiredAttributes(List<String> requiredAttributes)
+            throws IdentityProviderException {
+
+    }
+
     /**
      * Creates an instance of MessageExtension for the OpenID authentication
      * response

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDSimpleReg.java
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDSimpleReg.java
       (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/extensions/OpenIDSimpleReg.java
       Wed Apr  2 13:33:01 2008
@@ -1,17 +1,12 @@
 /*
- * Copyright 2005-2008 WSO2, Inc. (http://wso2.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2005-2008 WSO2, Inc. (http://wso2.com) Licensed under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 
 package org.wso2.solutions.identity.openid.extensions;
@@ -49,6 +44,68 @@
         this.request = request;
     }
 
+    public void addRequiredAttributes(List<String> requiredAttributes)
+            throws IdentityProviderException {
+
+        AuthRequest authRequest = null;
+        MessageExtension extension = null;
+
+        try {
+
+            authRequest = request.getAuthRequest();
+            extension = authRequest.getExtension(SRegRequest.OPENID_NS_SREG);
+
+            if (extension == null)
+                extension = authRequest
+                        
.getExtension(IdentityConstants.OpenId.SimpleRegAttributes.NS_SREG);
+
+            if (extension instanceof SRegRequest) {
+
+                SRegRequest sregReq = null;
+                List required = null;
+                List optional = null;
+
+                sregReq = (SRegRequest) extension;
+
+                // Get the required attributes as requested by the
+                // RP.
+                required = sregReq.getAttributes(true);
+                optional = sregReq.getAttributes();
+
+                if (optional != null && !optional.isEmpty()) {
+                    for (Object attr : optional) {
+                        if (!required.contains(attr)) {
+                            required.add(attr);
+                        }
+                    }
+                }
+
+                Map<String, ClaimDO> claims = null;
+                ClaimDO[] supportedClaims = null;
+                ClaimsAdmin claimsAdmin = null;
+
+                claims = new HashMap<String, ClaimDO>();
+
+                claimsAdmin = new ClaimsAdmin();
+                supportedClaims = claimsAdmin.getAllMappedEnabledClaims();
+
+                for (int i = 0; i < supportedClaims.length; i++) {
+                    ClaimDO temp = supportedClaims[i];
+                    if (temp.getOpenIDTag() != null)
+                        claims.put(temp.getOpenIDTag(), temp);
+                }
+
+                mapToAttriId(required, requiredAttributes, claims);
+            }
+
+        } catch (MessageException ex) {
+            throw new IdentityProviderException(
+                    IdentityConstants.ErrorCodes.OPENID_RESP_GENERATION_FAILED,
+                    ex);
+        }
+
+    }
+
     /**
      * Creates an instance of MessageExtension for the OpenID authentication
      * response

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
       (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/OpenIDAuthVerificationAction.java
       Wed Apr  2 13:33:01 2008
@@ -1,17 +1,12 @@
 /*
- * Copyright 2005-2008 WSO2, Inc. (http://wso2.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2005-2008 WSO2, Inc. (http://wso2.com) Licensed under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 
 package org.wso2.solutions.identity.user.ui.action;
@@ -19,7 +14,11 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
@@ -33,12 +32,15 @@
 import org.wso2.solutions.identity.IdentityProviderConstants;
 import org.wso2.solutions.identity.IdentityProviderException;
 import org.wso2.solutions.identity.UserStore;
+import org.wso2.solutions.identity.admin.ClaimsAdmin;
 import org.wso2.solutions.identity.admin.ReportAdmin;
+import org.wso2.solutions.identity.openid.OpenIDClaim;
 import org.wso2.solutions.identity.openid.OpenIDUtil;
 import org.wso2.solutions.identity.persistence.IPPersistenceManager;
 import org.wso2.solutions.identity.persistence.dataobject.ActionDO;
 import org.wso2.solutions.identity.persistence.dataobject.OpenIDUserRPDO;
 import org.wso2.solutions.identity.relyingparty.RelyingPartyException;
+import org.wso2.solutions.identity.user.ui.ClaimValue;
 import org.wso2.solutions.identity.user.ui.util.UserUtil;
 import org.wso2.solutions.identity.users.IdentityDefaultRealm;
 import org.wso2.solutions.identity.users.IdentityUserStoreReader;
@@ -55,8 +57,12 @@
 
     private List<String> profile = null;
 
+    private List<ClaimValue> claimValues = null;
+
     private String defaultUserProfileName = null;
 
+    private List<String> requiredAttributes = null;
+
     /**
      * This will get executed once the user provided his login credentials
      */
@@ -99,6 +105,9 @@
             return ERROR;
         }
 
+        requiredAttributes = (List<String>) session
+                .getAttribute("RequestedAttr");
+
         user = UserUtil.getUserName(openID);
 
         if (infoCardSignin != null && "Log in".equals(infoCardSignin)) {
@@ -349,6 +358,57 @@
 
             profile.add(0, defaultUserProfileName);
 
+            readDefaultProfileValues(userName, defaultUserProfileName);
+
+        } catch (IdentityProviderException e) {
+            throw new RelyingPartyException(
+                    IdentityConstants.ErrorCodes.PROFILE_RETRIEVAL_FAILURE, e);
+        } catch (UserManagerException e) {
+            throw new RelyingPartyException(
+                    IdentityConstants.ErrorCodes.PROFILE_RETRIEVAL_FAILURE, e);
+        }
+    }
+
+    /**
+     * @param userName
+     * @param profileName
+     * @throws RelyingPartyException
+     */
+    protected void readDefaultProfileValues(String userName, String 
profileName)
+            throws RelyingPartyException {
+
+        IdentityDefaultRealm realm = null;
+        IdentityUserStoreReader reader = null;
+        Map<String, String> userProperties = null;
+        ClaimsAdmin claimsAdmin = null;
+        ClaimValue calimValue = null;
+
+        try {
+            userProperties = new HashMap<String, String>();
+            realm = (IdentityDefaultRealm) UserStore.getInstance().getRealm();
+            reader = realm.getIdentityUserStoreReader();
+            userProperties = reader.getUserProperties(userName, profileName);
+
+            claimsAdmin = new ClaimsAdmin();
+            claimValues = new ArrayList<ClaimValue>();
+
+            Iterator<Entry<String, String>> iterator = null;
+            OpenIDClaim claim = null;
+            Entry<String, String> entry = null;
+
+            iterator = userProperties.entrySet().iterator();
+
+            while (iterator.hasNext()) {
+                entry = iterator.next();
+                calimValue = new ClaimValue();
+                calimValue.setClaimValue(entry.getValue());
+                if (requiredAttributes.contains(entry.getKey())) {
+                    calimValue.setClaim(claimsAdmin.findClaimByURI(entry
+                            .getKey()));
+                    claimValues.add(calimValue);
+                }
+            }
+
         } catch (IdentityProviderException e) {
             throw new RelyingPartyException(
                     IdentityConstants.ErrorCodes.PROFILE_RETRIEVAL_FAILURE, e);
@@ -356,6 +416,7 @@
             throw new RelyingPartyException(
                     IdentityConstants.ErrorCodes.PROFILE_RETRIEVAL_FAILURE, e);
         }
+
     }
 
     /**
@@ -406,6 +467,10 @@
         return true;
     }
 
+    public List<ClaimValue> getClaimValues() {
+        return claimValues;
+    }
+
     public List<String> getProfile() {
         return profile;
     }
@@ -422,4 +487,4 @@
         this.defaultUserProfileName = defaultUserProfileName;
     }
 
-}
+}
\ No newline at end of file

Modified: 
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidapproval.jsp
==============================================================================
--- 
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidapproval.jsp
   (original)
+++ 
branches/solutions/identity/1.5/solutions/identity/modules/user-ui/src/main/webapp/jsp/openidapproval.jsp
   Wed Apr  2 13:33:01 2008
@@ -1,6 +1,5 @@
 <%@ page session="true"%>
-<%@ page
-       
import="java.util.List,org.openid4java.message.AuthSuccess,org.openid4java.server.InMemoryServerAssociationStore,org.openid4java.message.DirectError,org.openid4java.message.Message,org.openid4java.message.ParameterList,org.openid4java.discovery.Identifier,org.openid4java.discovery.DiscoveryInformation,org.openid4java.message.ax.FetchRequest,org.openid4java.message.ax.FetchResponse,org.openid4java.message.ax.AxMessage,org.openid4java.message.*,org.openid4java.OpenIDException,java.util.List,java.io.IOException,javax.servlet.http.HttpSession,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.openid4java.server.ServerManager,org.openid4java.consumer.InMemoryConsumerAssociationStore,org.openid4java.consumer.VerificationResult"%>
+<%@ page import="org.openid4java.message.ParameterList"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
 "http://www.w3.org/TR/html4/strict.dtd";>
@@ -9,6 +8,15 @@
 <title>WSO2 Identity Solution | Management Console</title>
 <link type="text/css" rel="stylesheet" href="css/styles.css" />
 
+<script language="JavaScript" type="text/JavaScript">
+function showHide(){
+
+       var top_div=document.getElementById('claim-content');
+       if(top_div.style.display=='block') top_div.style.display='none';
+       else top_div.style.display='block';
+}
+</script>
+
 </head>
 <body>
 
@@ -41,35 +49,69 @@
                <table cellpadding="0" cellspacing="10" border="0"
                        class="login-header">
                        <tr>
-                               <td>
-                                       <div class="errors"><s:actionerror /> 
<s:fielderror /></div>
-                                       <table>
-                                               <tr>
-                                                       <td><strong>The site 
<%=openidreturnto%> wants to
-                                                       confirm your identity 
is <%=openididentity%>.</strong></td>
-                                               </tr>
-                                       </table>
-                                       <s:form 
action="/OpenIDUserApproval.action" name="approvalForm" id="approvalForm"
-                                       theme="simple" method="POST">
+                               <td width="60%">
+                               <div class="errors"><s:actionerror /> 
<s:fielderror /></div>
+                               <table>
+                                       <tr>
+                                               <td><strong>The site 
<%=openidreturnto%> wants to
+                                               confirm your identity is 
<%=openididentity%>.</strong></td>
+                                       </tr>
+                               </table>
+                               <s:form action="/OpenIDUserApproval.action" 
name="approvalForm"
+                                       id="approvalForm" theme="simple" 
method="POST">
                                        <table>
                                                <tr>
                                                        <td width="40%">
                                                        <table cellpadding="0" 
cellspacing="3" border="0"
                                                                
class="form-table">
-                                                               <tr><td>Select 
profile: </td><td colspan="2"><s:select list="profile" name="profileName" 
theme="simple"></s:select></td></tr>
-                                                               <tr 
height="10"><td colspan="3"></td></tr>
                                                                <tr>
-                                                                       
<td><input type="submit" name="approval"  value="Only Once" class="button"></td>
-                                                                       
<td><input type="submit" name="approval"  value="Always" class="button"></td>
-                                                                       
<td><input type="submit" name="approval"  value="Deny" class="button"></td>     
                                                        
+                                                                       
<td>Select profile:</td>
+                                                                       <td 
colspan="2"><s:select list="profile"
+                                                                               
name="profileName" theme="simple"></s:select></td>
+                                                               </tr>
+                                                               <tr height="10">
+                                                                       <td 
colspan="3"></td>
+                                                               </tr>
+                                                               <tr>
+                                                                       
<td><input type="submit" name="approval" value="Only Once"
+                                                                               
class="button"></td>
+                                                                       
<td><input type="submit" name="approval" value="Always"
+                                                                               
class="button"></td>
+                                                                       
<td><input type="submit" name="approval" value="Deny"
+                                                                               
class="button"></td>
                                                                </tr>
                                                        </table>
                                                        </td>
-
                                                </tr>
                                        </table>
-                                       </s:form>
-                               </td>
+                               </s:form></td>
+
+                               <td valign="top">
+                               <div id="claim-title" onclick="showHide()"><img
+                                       src="images/arrow-down.gif" align="top"
+                                       style="margin-top: 5px; margin-left: 
3px; margin-right: 3px;" />Click
+                               to see the claim values being sent to the 
relying party<img
+                                       src="images/arrow-down.gif" align="top"
+                                       style="margin-top: 5px; margin-left: 
3px; margin-right: 3px;" /></div>
+                               <div id="claim-content"><a href="#" 
onClick="showHide();"
+                                       class="close-link">Close [ x ]</a>
+
+
+                               <table cellpadding="0" cellspacing="0" 
border="0" class="data-table"
+                                       style="clear: both;">
+                                       <s:iterator value="claimValues">
+                                               <tr>
+                                                       <td>
+                                                       <div 
style="font-weight: bold; line-height: 18px;"><s:property
+                                                               
value="claim.displayTag" /></div>
+                                                       <div 
style="line-height: 18px;"><s:property
+                                                               
value="claimValue" /></div>
+                                                       </td>
+                                               </tr>
+                                       </s:iterator>
+                               </table>
+                               </div>
+                               </td>                           
                </table>
 
 

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

Reply via email to