Author: channa
Date: Wed Jan 30 03:15:40 2008
New Revision: 13174
Log:
Handling unregistered InfoCard error gracefully (MASHUP-622). Also made
InfoCard term usage consistent.
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
trunk/mashup/java/modules/www/infocardaccept.jsp
trunk/mashup/java/modules/www/signin.jsp
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/InfoCardHandler.java
Wed Jan 30 03:15:40 2008
@@ -15,6 +15,7 @@
*/
package org.wso2.mashup.webapp.identity;
+import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.mashup.MashupConstants;
@@ -58,14 +59,20 @@
HttpSession session = request.getSession();
ServletContext context = session.getServletContext();
JDBCRegistry jdbcRegistry =
- (JDBCRegistry)
context.getAttribute(RegistryConstants.REGISTRY);
- Realm realm = (Realm)
context.getAttribute(RegistryConstants.REGISTRY_REALM);
- String ppid = (String)
request.getAttribute(IdentityConstants.CLAIM_PPID);
- String userName = MashupUtils.login(ppid, session.getId());
- SecureRegistry secureRegistry = null;
- secureRegistry = RegistryUtils.createSecureRegistry(userName,
jdbcRegistry, realm);
- request.getSession().setAttribute(MashupConstants.USER_REGISTRY,
secureRegistry);
- success = true;
+ (JDBCRegistry)
context.getAttribute(RegistryConstants.REGISTRY);
+ Realm realm = (Realm)
context.getAttribute(RegistryConstants.REGISTRY_REALM);
+
+ // Attempt to get card information and create a secure registry
instance.
+ try {
+ String ppid = (String)
request.getAttribute(IdentityConstants.CLAIM_PPID);
+ String userName = MashupUtils.login(ppid, session.getId());
+ SecureRegistry secureRegistry =
RegistryUtils.createSecureRegistry(userName,
+ jdbcRegistry,
realm);
+
request.getSession().setAttribute(MashupConstants.USER_REGISTRY,
secureRegistry);
+ success = true;
+ } catch (AxisFault e) {
+ log.error("Infocard login failed.", e);
+ }
} else {
String reason =
(String)
request.getAttribute(TokenVerifierConstants.FAILURE_REASON);
Modified: trunk/mashup/java/modules/www/infocardaccept.jsp
==============================================================================
--- trunk/mashup/java/modules/www/infocardaccept.jsp (original)
+++ trunk/mashup/java/modules/www/infocardaccept.jsp Wed Jan 30 03:15:40 2008
@@ -62,7 +62,8 @@
response.sendRedirect(bounceback);
return;
} else {
- message = "Infocard based login failed.";
+ message = "InfoCard based login failed." +
+ "<br/><strong>If your browser supports CardSpace
authentication, please make sure you have registered your InfoCard</strong>.";
}
}
%>
Modified: trunk/mashup/java/modules/www/signin.jsp
==============================================================================
--- trunk/mashup/java/modules/www/signin.jsp (original)
+++ trunk/mashup/java/modules/www/signin.jsp Wed Jan 30 03:15:40 2008
@@ -179,7 +179,7 @@
class="box" align="center">
<tr>
<th>Sign-in to <%=
bundle.getString("main.title")%></th>
- <th width="50%">Use info card to enter <%=
bundle.getString("main.title")%></th>
+ <th width="50%">Use InfoCard to enter <%=
bundle.getString("main.title")%></th>
</tr>
<tr>
<td height="175">
@@ -214,7 +214,7 @@
<a
href="infocard.jsp?bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>"><img
src="images/infocard_92x64.png"
border="0"></a>
<br/><br/>
- Signin using your personal or managed
infocard.
+ Signin using your personal or managed
InfoCard.
<br/>
<br/>
<a
href="http://wso2.org/projects/solutions/identity"
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev