[seam-commits] Seam SVN: r9663 - in trunk/src/main: org/jboss/seam/security/openid and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Wed Nov 26 11:56:36 EST 2008
Author: norman.richards at jboss.com
Date: 2008-11-26 11:56:36 -0500 (Wed, 26 Nov 2008)
New Revision: 9663
Modified:
trunk/src/main/META-INF/components.xml
trunk/src/main/org/jboss/seam/security/openid/OpenId.java
Log:
cleanup openid
Modified: trunk/src/main/META-INF/components.xml
===================================================================
--- trunk/src/main/META-INF/components.xml 2008-11-26 16:27:07 UTC (rev 9662)
+++ trunk/src/main/META-INF/components.xml 2008-11-26 16:56:36 UTC (rev 9663)
@@ -18,6 +18,7 @@
<import>org.jboss.seam.security</import>
<import>org.jboss.seam.security.management</import>
<import>org.jboss.seam.security.permission</import>
+ <import>org.jboss.seam.security.openid</import>
<import>org.jboss.seam.captcha</import>
<import>org.jboss.seam.excel.exporter</import>
Modified: trunk/src/main/org/jboss/seam/security/openid/OpenId.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/openid/OpenId.java 2008-11-26 16:27:07 UTC (rev 9662)
+++ trunk/src/main/org/jboss/seam/security/openid/OpenId.java 2008-11-26 16:56:36 UTC (rev 9663)
@@ -29,10 +29,11 @@
import org.openid4java.message.ax.FetchRequest;
import org.openid4java.message.ax.FetchResponse;
- at Name("openid")
+ at Name("org.jboss.seam.security.openid.openid")
@Install(precedence=Install.BUILT_IN, classDependencies="org.openid4java.consumer.ConsumerManager")
@Scope(ScopeType.SESSION)
-public class OpenId implements Serializable
+public class OpenId
+ implements Serializable
{
String id;
String validatedId;
@@ -45,6 +46,9 @@
throws ConsumerException
{
manager = new ConsumerManager();
+ discovered = null;
+ id = null;
+ validatedId = null;
}
@@ -68,13 +72,10 @@
throws IOException
{
validatedId = null;
-
String returnToUrl = returnToUrl();
- System.out.println("return to " + returnToUrl);
String url = authRequest(id, returnToUrl);
- System.out.println("auth to --> " + url);
-
+
Redirect redirect = Redirect.instance();
redirect.captureCurrentView();
@@ -111,7 +112,6 @@
authReq.addExtension(fetch);
return authReq.getDestinationUrl(true);
- // httpResp.sendRedirect(authReq.getDestinationUrl(true));
} catch (OpenIDException e) {
e.printStackTrace();
}
@@ -129,7 +129,6 @@
public boolean loginImmediately() {
- System.out.println("* LOGIN IMMEDIATELY! " + validatedId);
if (validatedId !=null) {
Identity.instance().acceptExternallyAuthenticatedPrincipal((new OpenIdPrincipal(validatedId)));
return true;
@@ -139,11 +138,10 @@
}
public boolean isValid() {
- System.out.println("is valid?" + validatedId);
return validatedId != null;
}
- public String validatedId() {
+ public String getValidatedId() {
return validatedId;
}
@@ -155,10 +153,7 @@
// (which comes in as a HTTP request from the OpenID provider)
ParameterList response =
new ParameterList(httpReq.getParameterMap());
-
-
- System.out.println("DISCOVERED IS " + discovered);
-
+
// extract the receiving URL from the HTTP request
StringBuffer receivingURL = httpReq.getRequestURL();
String queryString = httpReq.getQueryString();
@@ -177,6 +172,7 @@
AuthSuccess authSuccess =
(AuthSuccess) verification.getAuthResponse();
+ System.out.println("*** EXT: " + authSuccess.getExtensions());
if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
FetchResponse fetchResp = (FetchResponse) authSuccess
.getExtension(AxMessage.OPENID_NS_AX);
@@ -195,4 +191,9 @@
return null;
}
+ public void logout()
+ throws ConsumerException
+ {
+ init();
+ }
}
More information about the seam-commits
mailing list