package org.scribe.builder.api;

import org.scribe.exceptions.*;
import org.scribe.model.*;

public class FacebookApi extends DefaultApi20
{
  private static final String AUTHORIZE_URL = "https://graph.facebook.com/oauth/authorize?response_type=token&client_id=%s&redirect_uri=%s";
  @Override
  public String getAuthorizationUrl(OAuthConfig config)
  {
    if(OAuthConstants.OUT_OF_BAND.equals(config.getCallback()))
    	throw new OAuthException("Facebook does not support oob authentication.");
    return String.format(AUTHORIZE_URL, config.getApiKey(), config.getCallback());
  }
}

@@ -84,16 +84,50 @@
 model.*;
+%0Aimport org.scribe.utils.URLUtils;
 %0A%0Apublic
@@ -585,16 +585,39 @@
 iKey(), 
+URLUtils.percentEncode(
 config.g
@@ -629,16 +629,17 @@
 lback())
+)
 ;%0A  %7D%0A%7D%0A

Encoding the callback url