Author: channa
Date: Mon Apr 28 04:24:05 2008
New Revision: 16265

Log:

OpenId WIP.


Modified:
   
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
   trunk/mashup/java/modules/www/openidsubmit.jsp
   trunk/mashup/java/pom.xml

Modified: 
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
==============================================================================
--- 
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
     (original)
+++ 
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
     Mon Apr 28 04:24:05 2008
@@ -91,6 +91,7 @@
      */
     public static boolean associateCardWithUser(HttpServletRequest request) 
throws MashupFault {
         boolean cardAdded = false;
+        String identifier;
         try {
             // Get the available user properties.
             UserRegistry userRegistry =
@@ -100,12 +101,18 @@
             UserStoreAdmin userStoreAdmin = realm.getUserStoreAdmin();
             Map userProps = 
realm.getUserStoreAdmin().getUserProperties(currentUser);
 
-            // If infocard has been successfully used, add the card's ppid to 
user's properties.
+            // If infocard or openid has been successfully used, add the 
card's identifier to user's properties.
             String auth = (String) 
request.getAttribute(TokenVerifierConstants.SERVLET_ATTR_STATE);
             String authMethod = (String) 
request.getAttribute(MashupConstants.AUTHENTICATION_METHOD);
             if (TokenVerifierConstants.STATE_SUCCESS.equals(auth)) {
-                String identifier = (String) 
request.getAttribute(IdentityConstants.CLAIM_PPID);
 
+                // Get the identifier used.
+                if (MashupConstants.INFOCARD.equals(authMethod)) {
+                    identifier = (String) 
request.getAttribute(IdentityConstants.CLAIM_PPID);
+                } else {
+                    identifier = (String) 
request.getAttribute(IdentityConstants.OpenId.SimpleRegAttributes.FULL_NAME); 
//todo - use correct
+                }
+                
                 // Add only if this identifier has not been associated with a 
user.
                 if (!InfoCardHandler.isIdentifierRegistered(request, 
identifier)) {
                     int regCardCount = 0;

Modified: trunk/mashup/java/modules/www/openidsubmit.jsp
==============================================================================
--- trunk/mashup/java/modules/www/openidsubmit.jsp      (original)
+++ trunk/mashup/java/modules/www/openidsubmit.jsp      Mon Apr 28 04:24:05 2008
@@ -1,36 +1,24 @@
-<[EMAIL PROTECTED] import="com.sun.syndication.feed.synd.*"%>
-<[EMAIL PROTECTED] import="com.sun.syndication.io.SyndFeedOutput"%>
-<[EMAIL PROTECTED] import="org.apache.axis2.context.ConfigurationContext"%>
+<%--
+ * Copyright 2006,2007 WSO2, Inc. http://www.wso2.org
+ *
+ * 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.
+--%>
 <[EMAIL PROTECTED] import="org.wso2.mashup.MashupConstants"%>
-<[EMAIL PROTECTED] import="org.wso2.mashup.MashupFault"%>
-<%@ page import="org.wso2.mashup.utils.MashupUtils" %>
-<%@ page import="org.wso2.mashup.utils.QueryResult" %>
-<%@ page import="org.wso2.mashup.utils.QueryResults" %>
-<%@ page import="org.wso2.mashup.webapp.MashupUiFault" %>
-<%@ page import="org.wso2.mashup.webapp.identity.InfoCardHandler" %>
-<%@ page import="org.wso2.mashup.webapp.identity.RegistrationBean" %>
-<%@ page import="org.wso2.mashup.webapp.userprofile.ManageUsers" %>
-<%@ page import="org.wso2.mashup.webapp.userprofile.User" %>
-<%@ page import="org.wso2.mashup.webapp.userprofile.UserInformation" %>
-<%@ page import="org.wso2.mashup.webapp.userprofile.UserQuery" %>
-<%@ page import="org.wso2.mashup.webapp.utils.QueryParamUtils" %>
-<%@ page import="org.wso2.mashup.webapp.utils.RegistryUtils" %>
-<%@ page import="org.wso2.registry.*" %>
-<%@ page import="org.wso2.registry.jdbc.EmbeddedRegistry" %>
-<%@ page import="org.wso2.registry.session.UserRegistry" %>
-<%@ page import="org.wso2.registry.users.UserRealm" %>
-<%@ page import="org.wso2.registry.users.UserStoreAdmin" %>
-<%@ page import="org.wso2.registry.users.UserStoreException" %>
 <%@ page import="org.wso2.solutions.identity.IdentityConstants" %>
 <%@ page 
import="org.wso2.solutions.identity.relyingparty.RelyingPartyException" %>
-<%@ page import="org.wso2.utils.ServerConfiguration" %>
-<%@ page import="org.wso2.wsas.ServerManager" %>
-<%@ page import="java.io.BufferedReader" %>
-<%@ page import="java.io.FileReader" %>
-<%@ page import="java.net.URL" %>
-<%@ page import="java.net.URLDecoder" %>
-<%@ page import="java.net.URLEncoder" %>
-<%@ page import="java.util.*" %>
+<%@ page 
import="org.wso2.solutions.identity.relyingparty.openid.OpenIDAuthenticationRequest"
 %>
+<%@ page 
import="org.wso2.solutions.identity.relyingparty.openid.OpenIDConsumer" %>
+<%@ page 
import="org.wso2.solutions.identity.relyingparty.openid.OpenIDRequestType" %>
 
 <%
     String calledFrom = request.getParameter("calledfrom");

Modified: trunk/mashup/java/pom.xml
==============================================================================
--- trunk/mashup/java/pom.xml   (original)
+++ trunk/mashup/java/pom.xml   Mon Apr 28 04:24:05 2008
@@ -1215,6 +1215,11 @@
             <artifactId>htmlparser</artifactId>
             <version>1.6</version>
         </dependency>
+        <dependency>
+            <groupId>opensaml</groupId>
+            <artifactId>openws</artifactId>
+            <version>${openws.version}</version>
+        </dependency>
     </dependencies>
 
     <modules>
@@ -1317,6 +1322,6 @@
 
         <opensaml.version>1.1.406</opensaml.version>
         <openid.version>0.9.3.1</openid.version>
-
+        <openws.version>1.0</openws.version>
     </properties>
 </project>

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to