Author: prabath Date: Thu Feb 21 04:34:27 2008 New Revision: 13975 Log:
javarp sample modified Added: trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openid-infocard-submit-sxip.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/openidsubmit.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 Thu Feb 21 04:34:27 2008 @@ -25,15 +25,32 @@ <hr/> <h2>OpenID Simple Registration Demo</h2> -<h3>OpenID Simple Registration is an extension to the OpenID Authentication protocol that allows for very light-weight profile exchange. It is designed to pass eight commonly requested pieces of information when an End User goes to register a new account with a web service. -</h3> -<img src="images/openid-logo.gif" /> +OpenID Simple Registration is an extension to the OpenID Authentication protocol that allows for very light-weight profile exchange. It is designed to pass eight commonly requested pieces of information when an End User goes to register a new account with a web service. <form name="frm" id="frm" method="post" action="openidsubmit.jsp?returnUrl=https://localhost:12443/javarp/openidloggedin.jsp"> OpenID Url: <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-simple-registration-extension-1_1-01.html">OpenID Simple Registration Extension 1.1 - Draft 1</a> + +<br/> + + +<hr/> + +<br/> + +<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"> + OpenID Url: <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> + <br/> @@ -45,6 +62,17 @@ <a href="openid-infocard-submit.html"><img src="images/openid_infocard.png" /></a> +<br/> + +<a href="https://openidcards.sxip.com/spec/openid-infocards.html">OpenID Information Cards 1.0 - Draft 01</a> + +<hr/> +<br/> + +<h2>OpenID Information Cards Demo with Sxip</h2> + +<a href="openid-infocard-submit-sxip.html"><img src="images/openid_infocard.png" /></a> + </body> </html> Added: trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openid-infocard-submit-sxip.html ============================================================================== --- (empty file) +++ trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openid-infocard-submit-sxip.html Thu Feb 21 04:34:27 2008 @@ -0,0 +1,23 @@ +<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +</head> +<body> + <form name="frm" id="frm" method="post" action="openidloggedin.jsp"> + <input type="hidden" name="InfoCardSignin" value="Log in" /><br/> + + <OBJECT type="application/x-informationCard" name="xmlToken"> + <PARAM Name="tokenType" Value="http://specs.openid.net/auth/2.0"> + <PARAM Name="requiredClaims" Value="http://schema.openid.net/2007/05/claims/identifier"> + <param name="optionalClaims" Value="http://axschema.org/contact/email http://axschema.org/namePerson/first http://axschema.org/namePerson/last http://axschema.org/contact/phone/default http://axschema.org/contact/postalAddress/home http://axschema.org/contact/city/home http://axschema.org/contact/postalCode/home http://axschema.org/contact/country/home http://axschema.org/contact/web/blog"> + </OBJECT> + + </form> + <script language="JavaScript" type="text/JavaScript"> + <!-- + document.frm.submit(); + --> + </script> +</body> +</html> \ No newline at end of file Added: trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidaxsubmit.jsp ============================================================================== --- (empty file) +++ trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidaxsubmit.jsp Thu Feb 21 04:34:27 2008 @@ -0,0 +1,74 @@ +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.relyingparty.TokenVerifierConstants"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.relyingparty.HTMLEncoder"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.IdentityConstants"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.openid.relyingparty.OpenIDAuthenticationRequest"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.openid.relyingparty.OpenIDConsumer"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.openid.relyingparty.OpenIDRequestType"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.relyingparty.RelyingPartyException"%> +<[EMAIL PROTECTED] import="org.wso2.utils.ServerConfiguration"%> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" +"http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +</head> +<body> + + <% + try + { + OpenIDAuthenticationRequest openIDAuthRequest = null; + openIDAuthRequest = new OpenIDAuthenticationRequest(request,response); + + openIDAuthRequest.setOpenIDUrl((String)request.getParameter("openIdUrl")); + + ServerConfiguration serverConfig = null; + String host = null; + String httpsPort = null; + + serverConfig = ServerConfiguration.getInstance(); + 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 + // 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.setReturnUrl("https://" + host + ":" + httpsPort + "/" + "javarp/openidloggedin.jsp"); + + OpenIDConsumer.getInstance().doOpenIDAuthentication(openIDAuthRequest); + } + catch(RelyingPartyException e) + { + out.println(e.getMessage()); + } + + + %> + +<br/><br/> + +<a href="index.html">Back</a> + +</body> + +</html> Modified: trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidsubmit.jsp ============================================================================== --- trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidsubmit.jsp (original) +++ trunk/solutions/identity/modules/samples/servlet-filter/src/main/webapp/openidsubmit.jsp Thu Feb 21 04:34:27 2008 @@ -3,10 +3,10 @@ <[EMAIL PROTECTED] import="org.wso2.solutions.identity.IdentityConstants"%> <[EMAIL PROTECTED] import="org.wso2.solutions.identity.openid.relyingparty.OpenIDAuthenticationRequest"%> <[EMAIL PROTECTED] import="org.wso2.solutions.identity.openid.relyingparty.OpenIDConsumer"%> +<[EMAIL PROTECTED] import="org.wso2.solutions.identity.openid.relyingparty.OpenIDRequestType"%> <[EMAIL PROTECTED] import="org.wso2.solutions.identity.relyingparty.RelyingPartyException"%> <[EMAIL PROTECTED] import="org.wso2.utils.ServerConfiguration"%> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> @@ -28,7 +28,30 @@ serverConfig = ServerConfiguration.getInstance(); host = serverConfig.getFirstProperty("HostName"); - httpsPort = serverConfig.getFirstProperty("Ports.HTTPS"); + httpsPort = serverConfig.getFirstProperty("Ports.HTTPS"); + + openIDAuthRequest.setRequestType(OpenIDRequestType.SIMPLE_REGISTRATION); + + // 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.setReturnUrl("https://" + host + ":" + httpsPort + "/" + "javarp/openidloggedin.jsp"); _______________________________________________ Identity-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/identity-dev
