Author: prabath
Date: Sun Feb 24 20:19:36 2008
New Revision: 14116

Log:

myopenid.net supports http://schema.openid.net - modified the sample to do 
interop testing with myopenid.net to test our RP components

Modified:
   
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/index.html
   
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidaxsubmit.jsp

Modified: 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/index.html
==============================================================================
--- 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/index.html
  (original)
+++ 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/index.html
  Sun Feb 24 20:19:36 2008
@@ -3,6 +3,22 @@
 <head>
        <title>Card Login</title>
 <link type="text/css" rel="stylesheet" href="css/styles.css" />
+
+<script type="text/javascript" language="JavaScript">
+
+        function useOpenIDSchema() {
+            var val = document.getElementById("openidschema").checked;
+            var schema = document.getElementById("useSchema");
+
+            if (val) {
+                schema.value = "true";
+            } else {
+                schema.value = "false";
+            }           
+        }
+
+</script>
+
 </head>
 <body>
 <img src="images/logo.gif" />
@@ -63,6 +79,9 @@
 
 <form name="frm" id="frm" method="post" 
action="openidaxsubmit.jsp?returnUrl=https://localhost:12443/javarp/openidloggedin.jsp";>
  
                OpenID Url:&nbsp;&nbsp;<input class='openid-url' id='openIdUrl' 
name="openIdUrl" size='30' /><br/><br/>
+            <input type="hidden" id="useSchema" name="useSchema" value="false" 
/>            
+
+            <input type="checkbox" id="openidschema" 
onclick="useOpenIDSchema();" />Use http://schema.openid.net <br/>
              <input type="submit" name="submit" value="Login" />   
 </form>
 

Modified: 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidaxsubmit.jsp
==============================================================================
--- 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidaxsubmit.jsp
  (original)
+++ 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidaxsubmit.jsp
  Sun Feb 24 20:19:36 2008
@@ -25,19 +25,54 @@
                        ServerConfiguration serverConfig = null;
                String host = null;
                String httpsPort = null;
+                  String useOpenIDSchema = null;
 
                serverConfig = ServerConfiguration.getInstance();
                host = serverConfig.getFirstProperty("HostName");
-               httpsPort = serverConfig.getFirstProperty("Ports.HTTPS");     
+               httpsPort = serverConfig.getFirstProperty("Ports.HTTPS");  
+
+                  useOpenIDSchema = (String)request.getParameter("useSchema");
 
 
                        openIDAuthRequest
                     .setRequestType(OpenIDRequestType.ATTRIBUTE_EXCHANGE);
 
+                 if (useOpenIDSchema != null && useOpenIDSchema 
.equalsIgnoreCase("true"))
+                 {
+
                // Set the required claims - I need these claims from the OpenID
                // Provider.
                openIDAuthRequest.addRequiredClaims(
                     IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME,
+                    "http://schema.openid.net/namePerson/friendly";);
+                   openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME,
+                    "http://schema.openid.net/namePerson";);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.EMAIL,
+                    "http://schema.openid.net/contact/email";);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.DOB,
+                    "http://schema.openid.net/birthDate";);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.GENDER,
+                    "http://schema.openid.net/person/gender";);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.POSTAL_CODE,
+                    "http://schema.openid.net/contact/postalCode/home";);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.COUNTRY,
+                    "http://schema.openid.net/contact/country/home";);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.LANGUAGE,
+                    "http://schema.openid.net/pref/language";);         
+                  }
+                  else
+                  { 
+                  // Set the required claims - I need these claims from the 
OpenID
+               // Provider.
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME,
                     IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME_NS);
                openIDAuthRequest.addRequiredClaims(
                     IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME,
@@ -63,7 +98,8 @@
                openIDAuthRequest.addRequiredClaims(
                     IdentityConstants.OpenId.ExchangeAttributes.TIMEZONE,
                     IdentityConstants.OpenId.ExchangeAttributes.TIMEZONE_NS);
-            
+                  }
+                                          
                openIDAuthRequest.setReturnUrl("https://"; + host + ":" + 
httpsPort + "/" + "javarp/openidloggedin.jsp");
 
                
OpenIDConsumer.getInstance().doOpenIDAuthentication(openIDAuthRequest);

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

Reply via email to