Author: prabath
Date: Fri Feb 22 00:58:47 2008
New Revision: 14034

Log:

fix for OpenID Attribute Exchange

Modified:
   
trunk/solutions/identity/modules/base/src/main/java/org/wso2/solutions/identity/IdentityConstants.java
   trunk/solutions/identity/modules/identity-provider/conf/initial-claims.xml
   
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProviderData.java
   
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/OpenIDTokenIssuer.java

Modified: 
trunk/solutions/identity/modules/base/src/main/java/org/wso2/solutions/identity/IdentityConstants.java
==============================================================================
--- 
trunk/solutions/identity/modules/base/src/main/java/org/wso2/solutions/identity/IdentityConstants.java
      (original)
+++ 
trunk/solutions/identity/modules/base/src/main/java/org/wso2/solutions/identity/IdentityConstants.java
      Fri Feb 22 00:58:47 2008
@@ -99,7 +99,7 @@
        public final static String XML_TOKEN = "xmlToken";
 
        public final static String PROFILE_NAME = "profileName";
-       
+
        public final static String DEFAULT_PROFILE = "Default Profile";
 
        public static class ErrorCodes {
@@ -189,16 +189,19 @@
                        public final static String VALUE = "openid.ext1.value.";
                        public final static String FETCH_RESPONSE = 
"fetch_response";
 
-                       public final static String NICK_NAME_NS = 
"/namePerson/friendly";
-                       public final static String EMAIL_NS = "/contact/email";
-                       public final static String FULL_NAME_NS = "/namePerson";
-                       public final static String DOB_NS = "/birthDate";
-                       public final static String GENDER_NS = "/person/gender";
-                       public final static String POSTAL_CODE_NS = 
"/contact/postalCode/home";
-                       public final static String COUNTRY_NS = 
"/contact/country/home";
-                       public final static String LANGUAGE_NS = 
"/pref/language";
-                       public final static String TIMEZONE_NS = 
"/pref/timezone";
-                       
+                       public final static String NICK_NAME_NS = NS
+                                       + "/namePerson/friendly";
+                       public final static String EMAIL_NS = NS + 
"/contact/email";
+                       public final static String FULL_NAME_NS = NS + 
"/namePerson";
+                       public final static String DOB_NS = NS + "/birthDate";
+                       public final static String GENDER_NS = NS + 
"/person/gender";
+                       public final static String POSTAL_CODE_NS = NS
+                                       + "/contact/postalCode/home";
+                       public final static String COUNTRY_NS = NS
+                                       + "/contact/country/home";
+                       public final static String LANGUAGE_NS = NS + 
"/pref/language";
+                       public final static String TIMEZONE_NS = NS + 
"/pref/timezone";
+
                        public final static String NICK_NAME = "nicknameAx";
                        public final static String EMAIL = "emailAx";
                        public final static String FULL_NAME = "fullnameAx";

Modified: 
trunk/solutions/identity/modules/identity-provider/conf/initial-claims.xml
==============================================================================
--- trunk/solutions/identity/modules/identity-provider/conf/initial-claims.xml  
(original)
+++ trunk/solutions/identity/modules/identity-provider/conf/initial-claims.xml  
Fri Feb 22 00:58:47 2008
@@ -130,15 +130,15 @@
                        <OpenIDTag>postcodeAx</OpenIDTag>
                </ClaimType>
                <ClaimType Uri="http://axschema.org/contact/country/home";>
-                       <DisplayTag>Time Zone</DisplayTag>
-                       <Description>Time Zone</Description>
-                       <OpenIDTag>timezoneAx</OpenIDTag>
-               </ClaimType>
-               <ClaimType Uri="http://axschema.org/pref/language";>
                        <DisplayTag>Country</DisplayTag>
                        <Description>Country</Description>
                        <OpenIDTag>countryAx</OpenIDTag>
                </ClaimType>
+               <ClaimType Uri="http://axschema.org/pref/language";>
+                       <DisplayTag>Langauge</DisplayTag>
+                       <Description>Language</Description>
+                       <OpenIDTag>languageAx</OpenIDTag>
+               </ClaimType>
                <ClaimType Uri="http://axschema.org/pref/timezone";>
                        <DisplayTag>Time Zone</DisplayTag>
                        <Description>Time Zone</Description>

Modified: 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProviderData.java
==============================================================================
--- 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProviderData.java
 (original)
+++ 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/openid/OpenIDProviderData.java
 Fri Feb 22 00:58:47 2008
@@ -68,7 +68,7 @@
         for (int i = 0; i < supportedClaims.length; i++) {
             ClaimDO temp = supportedClaims[i];
             if (temp.getOpenIDTag() != null)
-                claims.put(temp.getUri(), temp);
+                claims.put(temp.getOpenIDTag(), temp);
         }
 
         return populateAttributeValues(requiredClaims.keySet(), userId, 
claims);
@@ -78,7 +78,7 @@
      * Populate the required claims with claim values.
      * @param requiredClaims Required claims as requested by the RP.
      * @param userId User ID.
-     * @return A map, populated with required claim values.
+     * @return A map, populated with ClaimDO objects which have OpenIDTag, 
that is OpenID supported claims.
      * @throws IdentityProviderException
      */
     protected Map populateAttributeValues(Collection requiredClaims,
@@ -190,7 +190,7 @@
         while (iterator.hasNext()) {
             key = (String) iterator.next();
             claim = (OpenIDClaim) claimValues.get(key);
-            response.addAttribute(claim.typeUri, claim.claimValue);
+            response.addAttribute(claim.openIDTag,claim.typeUri, 
claim.claimValue);
         }
     }
 

Modified: 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/OpenIDTokenIssuer.java
==============================================================================
--- 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/OpenIDTokenIssuer.java
     (original)
+++ 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/OpenIDTokenIssuer.java
     Fri Feb 22 00:58:47 2008
@@ -141,9 +141,7 @@
 
     /**
      * Creates an OpenID token.
-     * 
-     * @param rstrElem
-     *                RSTR token
+     * @param rstrElem RSTR token
      * @return OpenID token
      * @throws MessageException
      */
@@ -189,9 +187,7 @@
 
     /**
      * Set the attributes in the structure required by the Attribute Exchange.
-     * 
-     * @param params
-     *                Parameter list
+     * @param params Parameter list
      */
     protected void setAttributeExchangeParams(ParameterList params) {
 
@@ -233,9 +229,7 @@
 
     /**
      * Set the attributes in the structure required by the Simple Registration.
-     * 
-     * @param params
-     *                Parameter list
+     * @param params Parameter list
      */
     protected void setSimpleAttributeParams(ParameterList params) {
 

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

Reply via email to