Author: prabath
Date: Wed Dec 12 22:00:13 2007
New Revision: 11050
Log:
Modified to support OpenID integration
Added:
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/openidloggedin.jsp
Modified:
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/index.html
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/infocard-submit.html
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/login.jsp
Modified:
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/index.html
==============================================================================
---
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/index.html
(original)
+++
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/index.html
Wed Dec 12 22:00:13 2007
@@ -1,30 +1,40 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Card Login</title>
-</head>
-<body>
-<img src="images/logo.gif" />
-
-<h2><a href="infocard-submit.html"><img border="0"
src="images/infocard_46x32.png" />Login with your InfoCard</a></h2>
-<br/>
-
-
-<hr/>
-
-<form name="frm" id="frm" method="post" action="login.jsp">
- <input type="hidden" name="InfoCardSignin" value="Log
in" /><br/>
- <OBJECT type="application/x-informationCard" name="xmlToken">
- <PARAM Name="tokenType"
- Value="urn:oasis:names:tc:SAML:1.0:assertion">
-
- <PARAM Name="requiredClaims"
-
Value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier">
- <PARAM Name='optionalClaims'
value='http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage'>
- </OBJECT>
- <input type="submit" name="submit" value="Login" />
- </form>
-
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Card Login</title>
+</head>
+<body>
+<img src="images/logo.gif" />
+
+<h2><a href="infocard-submit.html"><img border="0"
src="images/infocard_46x32.png" />Login with your InfoCard</a></h2>
+
+
+<form name="frm" id="frm" method="post" action="login.jsp">
+ <input type="hidden" name="InfoCardSignin" value="Log
in" /><br/>
+ <OBJECT type="application/x-informationCard" name="xmlToken">
+ <PARAM Name="tokenType"
+ Value="urn:oasis:names:tc:SAML:1.0:assertion">
+
+ <PARAM Name="requiredClaims"
+
Value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier">
+ <PARAM Name='optionalClaims'
value='http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage'>
+ </OBJECT>
+ <input type="submit" name="submit" value="Login" />
+ </form>
+<hr/>
+
+<h2>Login with your OpenID</h2>
+
+<form name="frm" id="frm" method="post"
action="https://localhost:12443/OpenIdSubmit.action?returnUrl=https://localhost:12443/javarp/openidloggedin.jsp">
+ Enter Your OpenID Url: <input type="text" size=40
name="openIdUrl" /><br/><br/>
+ <input type="submit" name="submit" value="Login" />
+</form>
+
+<br/>
+
+
+<hr/>
+
+
+</body>
+</html>
Modified:
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/infocard-submit.html
==============================================================================
---
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/infocard-submit.html
(original)
+++
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/infocard-submit.html
Wed Dec 12 22:00:13 2007
@@ -1,24 +1,24 @@
-<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="login.jsp">
- <input type="hidden" name="InfoCardSignin" value="Log
in" /><br/>
- <OBJECT type="application/x-informationCard" name="xmlToken">
- <PARAM Name="tokenType"
- Value="urn:oasis:names:tc:SAML:1.0:assertion">
-
- <PARAM Name="requiredClaims"
-
Value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier">
- <PARAM Name='optionalClaims'
value='http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage'>
- </OBJECT>
- </form>
- <script language="JavaScript" type="text/JavaScript">
- <!--
- document.frm.submit();
- -->
- </script>
-</body>
+<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="login.jsp">
+ <input type="hidden" name="InfoCardSignin" value="Log
in" /><br/>
+ <OBJECT type="application/x-informationCard" name="xmlToken">
+ <PARAM Name="tokenType"
+ Value="urn:oasis:names:tc:SAML:1.0:assertion">
+
+ <PARAM Name="requiredClaims"
+
Value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier
http://schema.openid.net/2007/05/claims/identifier">
+ <PARAM Name='optionalClaims'
value='http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage'>
+ </OBJECT>
+ </form>
+ <script language="JavaScript" type="text/JavaScript">
+ <!--
+ document.frm.submit();
+ -->
+ </script>
+</body>
</html>
\ No newline at end of file
Modified:
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/login.jsp
==============================================================================
---
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/login.jsp
(original)
+++
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/login.jsp
Wed Dec 12 22:00:13 2007
@@ -1,56 +1,58 @@
-<[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"%>
-<html>
-<head><title>Hello, World</title></head>
-<body>
-<img src="images/logo.gif" />
-
-<%
-
-String auth =
(String)request.getAttribute(TokenVerifierConstants.SERVLET_ATTR_STATE);
-if(auth != null && TokenVerifierConstants.STATE_SUCCESS.equals(auth)) {
-String givenName =
(String)request.getAttribute(IdentityConstants.CLAIM_GIVEN_NAME);
-String surname = (String)request.getAttribute(IdentityConstants.CLAIM_SURNAME);
-String email =
(String)request.getAttribute(IdentityConstants.CLAIM_EMAIL_ADDRESS);
-
-if(givenName == null){
-%>
-<h2>Error! Given name is null</h2>
-<%
-}else if(surname == null){
-%>
-<h2>Error! Surname is null</h2>
-<%
-}else if(email == null){
-%>
-<h2>Error! Email is null</h2>
-<%
-}else{
-
-%>
-<h2>Welcome <%= HTMLEncoder.encode(givenName) %>
-<%= HTMLEncoder.encode(surname) %> !!!</h2>
-<p></p>
-
-<%=HTMLEncoder.encode(email) %> </br>
-
-You are logged into the WSO2 Identity Solution Sample Relying Party :-)
-<%
-}
-} else {
-%>
-
-<h2>Login failure !!!</h2>
-<h3><%=(String)request.getAttribute(TokenVerifierConstants.FAILURE_REASON)
%></h3>
-<%
-}
-%>
-
-<a href="index.html">Back</a>
-
-<hr/>
-<a href="http://www.wso2.org/projects/solutions/identity">WSO2 Identity
Solution</a>
-
-</body>
+<[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.OpenIdConsumer"%>
+
+<html>
+<head><title>Hello, World</title></head>
+<body>
+<img src="images/logo.gif" />
+
+<%
+
+String auth =
(String)request.getAttribute(TokenVerifierConstants.SERVLET_ATTR_STATE);
+if(auth != null && TokenVerifierConstants.STATE_SUCCESS.equals(auth)) {
+String givenName =
(String)request.getAttribute(IdentityConstants.CLAIM_GIVEN_NAME);
+String surname = (String)request.getAttribute(IdentityConstants.CLAIM_SURNAME);
+String email =
(String)request.getAttribute(IdentityConstants.CLAIM_EMAIL_ADDRESS);
+
+if(givenName == null){
+%>
+<h2>Error! Given name is null</h2>
+<%
+}else if(surname == null){
+%>
+<h2>Error! Surname is null</h2>
+<%
+}else if(email == null){
+%>
+<h2>Error! Email is null</h2>
+<%
+}else{
+
+%>
+<h2>Welcome <%= HTMLEncoder.encode(givenName) %>
+<%= HTMLEncoder.encode(surname) %> !!!</h2>
+<p></p>
+
+<%=HTMLEncoder.encode(email) %> </br>
+
+You are logged into the WSO2 Identity Solution Sample Relying Party :-)
+<%
+}
+} else {
+%>
+
+<h2>Login failure !!!</h2>
+<h3><%=(String)request.getAttribute(TokenVerifierConstants.FAILURE_REASON)
%></h3>
+<%
+}
+%>
+
+<a href="index.html">Back</a>
+
+<hr/>
+<a href="http://www.wso2.org/projects/solutions/identity">WSO2 Identity
Solution</a>
+
+</body>
</html>
\ No newline at end of file
Added:
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/openidloggedin.jsp
==============================================================================
--- (empty file)
+++
branches/solutions/identity/openid-poc/modules/samples/servlet-filter/src/main/webapp/openidloggedin.jsp
Wed Dec 12 22:00:13 2007
@@ -0,0 +1,92 @@
+<[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.OpenIdConsumer "%>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+</head>
+<body>
+<%
+OpenIdConsumer consumer=OpenIdConsumer.getInstance();
+consumer.setSessionAttributes(request);
+
+%>
+
+
+<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
+ <tr>
+
+ <table cellpadding="0" cellspacing="10" border="0"
+
+ <tr>
+ <td valign="top" width="30%">
+ <strong>Logged in
Successfully...!</strong><br />
+ </td>
+ </tr>
+ <% if (request.getAttribute("nickname") != null) { %>
+ <tr>
+ <td>Nick Name:</td>
+ <td><%=request.getAttribute("nickname")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("fullname") != null) { %>
+ <tr>
+ <td>Full Name:</td>
+ <td><%=request.getAttribute("fullname")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("email") != null) { %>
+ <tr>
+ <td>Email Address:</td>
+ <td><%=request.getAttribute("email")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("dob") != null) { %>
+ <tr>
+ <td>DOB:</td>
+ <td><%=request.getAttribute("dob")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("gender") != null) { %>
+ <tr>
+ <td>Gender:</td>
+ <td><%=request.getAttribute("gender")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("postcode") != null) { %>
+ <tr>
+ <td>Postcode:</td>
+ <td><%=request.getAttribute("postcode")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("country") != null) { %>
+ <tr>
+ <td>Country:</td>
+ <td><%=request.getAttribute("country")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("language") != null) { %>
+ <tr>
+ <td>Language:</td>
+ <td><%=request.getAttribute("language")%></td>
+ </tr>
+ <%}%>
+ <% if (request.getAttribute("timezone") != null) { %>
+ <tr>
+ <td>Timezone:</td>
+ <td><%=request.getAttribute("timezone")%></td>
+ </tr>
+ <%}%>
+
+ </table>
+ </td>
+ </tr>
+</table>
+
+
+</body>
+
+</html>
\ No newline at end of file
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev