Changed percentEncodings
This commit is contained in:
1 parent
d19c5d6e35
commit
bb872e4466
2 files changed
+5
-4
No files matched your search
@@ -11,6 +11,6 @@ public class FacebookApi extends DefaultApi20
|
||||
public String getAuthorizationUrl(OAuthConfig config)
|
||||
{
|
||||
Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback. Facebook does not support OOB");
|
||||
return String.format(AUTHORIZE_URL, config.getApiKey(), URLUtils.percentEncode(config.getCallback()));
|
||||
return String.format(AUTHORIZE_URL, config.getApiKey(), URLUtils.formURLEncode(config.getCallback()));
|
||||
}
|
||||
}
|
||||
@@ -27,10 +27,11 @@ public class TokenExtractorImpl implements RequestTokenExtractor, AccessTokenExt
|
||||
Matcher matcher = Pattern.compile(TOKEN_REGEX).matcher(response);
|
||||
if (matcher.matches())
|
||||
{
|
||||
String token = URLUtils.percentDecode(matcher.group(1));
|
||||
String secret = URLUtils.percentDecode(matcher.group(2));
|
||||
String token = URLUtils.formURLDecode(matcher.group(1));
|
||||
String secret = URLUtils.formURLDecode(matcher.group(2));
|
||||
return new Token(token, secret);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new OAuthException("Response body is incorrect. Can't extract a token from this: '" + response + "'", null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user