Commit 57597d40 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Updated X-FACEBOOK-PLATFORM support to reflect updates from Facebook.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@12870 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9242e523
...@@ -33,7 +33,7 @@ import org.jivesoftware.smack.util.Base64; ...@@ -33,7 +33,7 @@ import org.jivesoftware.smack.util.Base64;
*/ */
public class FacebookConnectSASLMechanism extends SASLMechanism { public class FacebookConnectSASLMechanism extends SASLMechanism {
private String sessionKey = ""; private String accessToken = "";
private String appSecret = ""; private String appSecret = "";
private String apiKey = ""; private String apiKey = "";
...@@ -60,23 +60,23 @@ public class FacebookConnectSASLMechanism extends SASLMechanism { ...@@ -60,23 +60,23 @@ public class FacebookConnectSASLMechanism extends SASLMechanism {
getSASLAuthentication().send(new AuthMechanism(getName(), null)); getSASLAuthentication().send(new AuthMechanism(getName(), null));
} }
public void authenticate(String apiKeyAndAppSecret, String host, String sessionKey) public void authenticate(String apiKeyAndAppSecret, String host, String accessToken)
throws IOException, XMPPException { throws IOException, XMPPException {
if(apiKeyAndAppSecret==null || sessionKey==null) if(apiKeyAndAppSecret==null || accessToken==null)
throw new IllegalStateException("Invalid parameters!"); throw new IllegalStateException("Invalid parameters!");
String[] keyArray = apiKeyAndAppSecret.split("\\|"); String[] keyArray = apiKeyAndAppSecret.split("\\|");
if(keyArray==null || keyArray.length != 2) if(keyArray==null || keyArray.length != 2)
throw new IllegalStateException("Api key or session key is not present!"); throw new IllegalStateException("Api key or access token is not present!");
this.apiKey = keyArray[0]; this.apiKey = keyArray[0];
this.appSecret = keyArray[1]; this.appSecret = keyArray[1];
this.sessionKey = sessionKey; this.accessToken = accessToken;
this.authenticationId = sessionKey; this.authenticationId = accessToken;
this.password = sessionKey; this.password = accessToken;
this.hostname = host; this.hostname = host;
String[] mechanisms = { "DIGEST-MD5" }; String[] mechanisms = { "DIGEST-MD5" };
...@@ -116,7 +116,7 @@ public class FacebookConnectSASLMechanism extends SASLMechanism { ...@@ -116,7 +116,7 @@ public class FacebookConnectSASLMechanism extends SASLMechanism {
+"call_id="+callId +"call_id="+callId
+"method="+method +"method="+method
+"nonce="+nonce +"nonce="+nonce
+"session_key="+sessionKey +"access_token="+accessToken
+"v="+version +"v="+version
+appSecret; +appSecret;
...@@ -130,7 +130,7 @@ public class FacebookConnectSASLMechanism extends SASLMechanism { ...@@ -130,7 +130,7 @@ public class FacebookConnectSASLMechanism extends SASLMechanism {
+"call_id="+callId+"&" +"call_id="+callId+"&"
+"method="+method+"&" +"method="+method+"&"
+"nonce="+nonce+"&" +"nonce="+nonce+"&"
+"session_key="+sessionKey+"&" +"access_token="+accessToken+"&"
+"v="+version+"&" +"v="+version+"&"
+"sig="+sig; +"sig="+sig;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment