Author: prabath
Date: Fri Feb 22 00:57:26 2008
New Revision: 14033

Log:

javarp sample modified to demonstrate OpenID Attribute Exchange

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
   
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidloggedin.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
  Fri Feb 22 00:57:26 2008
@@ -32,7 +32,7 @@
              <input type="submit" name="submit" value="Login" />   
 </form>
 
-<a 
href="http://openid.net/specs/openid-simple-registration-extension-1_1-01.html";>OpenID
 Simple Registration Extension 1.1 - Draft 1</a>
+Specification: <a 
href="http://openid.net/specs/openid-simple-registration-extension-1_1-01.html";>OpenID
 Simple Registration Extension 1.1 - Draft 1</a>
 
 <br/>
 
@@ -44,12 +44,13 @@
 <h2>OpenID Attribute Exchange Demo</h2>
 OpenID Attribute Exchange is an OpenID service extension for exchanging 
identity information between endpoints.
 
-<form name="frm" id="frm" method="post" 
action="openidsubmit.jsp?returnUrl=https://localhost:12443/javarp/openidloggedin.jsp";>
  
+<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="submit" name="submit" value="Login" />   
 </form>
 
-<a href="http://openid.net/specs/openid-attribute-exchange-1_0.html";>OpenID 
Attribute Exchange 1.0 - Final</a>
+Specification: <a 
href="http://openid.net/specs/openid-attribute-exchange-1_0.html";>OpenID 
Attribute Exchange 1.0 - Final</a><br/>
+Schema:<a href="http://www.axschema.org/types/";>http://www.axschema.org</a>
 
 <br/>
 
@@ -64,7 +65,7 @@
 
 <br/>
 
-<a href="https://openidcards.sxip.com/spec/openid-infocards.html";>OpenID 
Information Cards 1.0 - Draft 01</a>
+Specification: <a 
href="https://openidcards.sxip.com/spec/openid-infocards.html";>OpenID 
Information Cards 1.0 - Draft 01</a>
 
 <hr/>
 <br/>

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
  Fri Feb 22 00:57:26 2008
@@ -30,28 +30,39 @@
                host = serverConfig.getFirstProperty("HostName");
                httpsPort = serverConfig.getFirstProperty("Ports.HTTPS");     
 
-                  
openIDAuthRequest.setRequestType(OpenIDRequestType.SIMPLE_REGISTRATION);
 
-                       // Set the required claims - I need these claims from 
the OpenID
+                       openIDAuthRequest
+                    .setRequestType(OpenIDRequestType.ATTRIBUTE_EXCHANGE);
+
+               // Set the required claims - I need these claims from the OpenID
                // Provider.
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.NICK_NAME);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.FULL_NAME);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.EMAIL);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.DOB);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.GENDER);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.POSTAL_CODE);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.COUNTRY);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.LANGUAGE);
-               openIDAuthRequest
-                    
.addRequiredClaims(IdentityConstants.OpenId.SimpleRegAttributes.TIMEZONE);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME,
+                    IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME,
+                    IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.EMAIL,
+                    IdentityConstants.OpenId.ExchangeAttributes.EMAIL_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.DOB,
+                    IdentityConstants.OpenId.ExchangeAttributes.DOB_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.GENDER,
+                    IdentityConstants.OpenId.ExchangeAttributes.GENDER_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.POSTAL_CODE,
+                    
IdentityConstants.OpenId.ExchangeAttributes.POSTAL_CODE_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.COUNTRY,
+                    IdentityConstants.OpenId.ExchangeAttributes.COUNTRY_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.LANGUAGE,
+                    IdentityConstants.OpenId.ExchangeAttributes.LANGUAGE_NS);
+               openIDAuthRequest.addRequiredClaims(
+                    IdentityConstants.OpenId.ExchangeAttributes.TIMEZONE,
+                    IdentityConstants.OpenId.ExchangeAttributes.TIMEZONE_NS);
             
                openIDAuthRequest.setReturnUrl("https://"; + host + ":" + 
httpsPort + "/" + "javarp/openidloggedin.jsp");
 

Modified: 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidloggedin.jsp
==============================================================================
--- 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidloggedin.jsp
  (original)
+++ 
trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidloggedin.jsp
  Fri Feb 22 00:57:26 2008
@@ -81,6 +81,62 @@
                                <td><%=request.getAttribute("timezone")%></td>
                        </tr>
                        <%}%>
+
+                       <% if (request.getAttribute("nicknameax") != null) { %>
+                       <tr>
+                               <td>Nick Name:</td>
+                               <td><%=request.getAttribute("nicknameax")%></td>
+                       </tr>
+                       <%}%>
+
+                       <% if (request.getAttribute("fullnameax") != null) { %>
+                       <tr>
+                               <td>Full Name:</td>
+                               <td><%=request.getAttribute("fullnameax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("emailax") != null) { %>
+                       <tr>
+                               <td>Email Address:</td>
+                               <td><%=request.getAttribute("emailax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("dobax") != null) { %>
+                       <tr>
+                               <td>DOB:</td>
+                               <td><%=request.getAttribute("dobax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("genderax") != null) { %>
+                       <tr>
+                               <td>Gender:</td>
+                               <td><%=request.getAttribute("genderax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("postcodeax") != null) { %>
+                       <tr>
+                               <td>Postcode:</td>
+                               <td><%=request.getAttribute("postcodeax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("countryax") != null) { %>
+                       <tr>
+                               <td>Country:</td>
+                               <td><%=request.getAttribute("countryax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("languageax") != null) { %>
+                       <tr>
+                               <td>Language:</td>
+                               <td><%=request.getAttribute("languageax")%></td>
+                       </tr>
+                       <%}%>
+                       <% if (request.getAttribute("timezoneax") != null) { %>
+                       <tr>
+                               <td>Timezone:</td>
+                               <td><%=request.getAttribute("timezoneax")%></td>
+                       </tr>
+                       <%}%>
                
                </table>
 

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

Reply via email to