Author: anil.saldhana(a)jboss.com
Date: 2011-09-18 03:20:17 -0400 (Sun, 18 Sep 2011)
New Revision: 1226
Modified:
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookAuthenticator.java
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookLoginModule.java
Log:
save the original request
Modified:
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookAuthenticator.java
===================================================================
---
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookAuthenticator.java 2011-09-18
07:19:35 UTC (rev 1225)
+++
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookAuthenticator.java 2011-09-18
07:20:17 UTC (rev 1226)
@@ -79,11 +79,9 @@
protected boolean saveRestoreRequest = true;
public static String EMPTY_PASSWORD = "EMPTY";
-
- public enum STATES { AUTH, AUTHZ, FINISH};
-
-
+ private enum STATES { AUTH, AUTHZ, FINISH};
+
public void setReturnURL(String returnURL)
{
this.returnURL = returnURL;
@@ -157,7 +155,11 @@
return true;
if( state == null || state.isEmpty())
- {
+ {
+ if (saveRestoreRequest)
+ {
+ this.saveRequest(request, request.getSessionInternal());
+ }
Map<String, String> params = new HashMap<String, String>();
params.put(OAuthConstants.REDIRECT_URI_PARAMETER, this.returnURL);
params.put(OAuthConstants.CLIENT_ID_PARAMETER, this.clientID);
@@ -192,6 +194,7 @@
Principal principal = null;
facebookPrincipal = handleAuthenticationResponse(request, response);
+ request.getSession().setAttribute("principal", facebookPrincipal);
cachedPrincipal.set(facebookPrincipal);
if(isJBossEnv())
Modified:
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookLoginModule.java
===================================================================
---
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookLoginModule.java 2011-09-18
07:19:35 UTC (rev 1225)
+++
social/trunk/facebook/src/main/java/org/picketlink/social/facebook/FacebookLoginModule.java 2011-09-18
07:20:17 UTC (rev 1226)
@@ -42,7 +42,7 @@
@Override
protected Principal getIdentity()
{
- return new SimplePrincipal(FacebookAuthenticator.cachedPrincipal.get().getName());
+ return FacebookAuthenticator.cachedPrincipal.get();
}
@Override