Title: Problem generating access token
Last modified: August 21, 2016

---

# Problem generating access token

 *  Resolved [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/)
 * I am having problems getting WPBook Lite installed and working. I initially tried
   WPBook (but cannot access my blog through https).
 * I have an app on Facebook. I’ve put the App ID and Secret. If I click on the 
   link to visit the app profile, it all works ok.
 * I have my own profile ID in, and I want WPBook Lite to publish my posts to a 
   Facebook Group, so have entered the Group ID.
 * The Website URL in my app settings of Facebook are set to the same URL as my 
   blog.
 * When I click on Generate Access Token, it opens up Facebook and asks for permissions
   to access my public profile, I give this then give permission to post publicly
   and permission to manage my pages.
 * Facebook then returns to my blog URL with the following ?wpbook=oauth&code=(and
   a really long code)
 * BUT at this point, the web page for the return URL is empty – nothing is displayed,
   I don’t get taken back to the WPBook lite settings etc, and therefore I cannot
   complete the installation.
 * [http://wordpress.org/plugins/wpbook-lite/](http://wordpress.org/plugins/wpbook-lite/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [John Eckman](https://wordpress.org/support/users/johneckman/)
 * (@johneckman)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033615)
 * Chrismillard – so when you are taken back to your blog, with the oauth code, 
   you just land on your blog homepage and nothing happens?
 * When you say “the web page for the return URL is empty” do you mean you get just
   a blank white screen?
 * If so, that means some kind of PHP error is being thrown – you’ll need access
   to the server error logs to see what it is.
 * It may be that your server doesn’t allow wp_remote_request – doesn’t allow WordPress
   to call Facebook server-side, necessary for getting an OAuth token.
 *  Thread Starter [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033639)
 * Actually, sorry – it’s Facebook that shows the blank page. The URL shows
 * [http://apps.facebook.com/jslochwpbook/?wp_user=3&code=AQDLqB-jrlN3Wz_1i6kYb332DMep2n_bZ36RKTtV2Zw34uq6h8yzHX_ni_sHGKI1rSwI7dQWGpvJ_r3BktmhKr-yj1nlNrK7f81FCr7m-0O00JyoW8eOrbYd3nDJPDV4IhNfUjTA8EzLo2s-oyeO2NIubdA4sT-dDy2sGRUJRI_ReAAy574HWUg-Dx2aotNDCILhf3l1STU4DjUZYaYVhgKNyvJVemr-calU7oQ6vQh-zRb-G0o70n6uRhvb8HmyvuNAr08emgqWg8oVf5nGM1OaYiAN0566x7DLj3Nnuw_ycJudw3aG5zOhRnzwRK_KmRA#_=_](http://apps.facebook.com/jslochwpbook/?wp_user=3&code=AQDLqB-jrlN3Wz_1i6kYb332DMep2n_bZ36RKTtV2Zw34uq6h8yzHX_ni_sHGKI1rSwI7dQWGpvJ_r3BktmhKr-yj1nlNrK7f81FCr7m-0O00JyoW8eOrbYd3nDJPDV4IhNfUjTA8EzLo2s-oyeO2NIubdA4sT-dDy2sGRUJRI_ReAAy574HWUg-Dx2aotNDCILhf3l1STU4DjUZYaYVhgKNyvJVemr-calU7oQ6vQh-zRb-G0o70n6uRhvb8HmyvuNAr08emgqWg8oVf5nGM1OaYiAN0566x7DLj3Nnuw_ycJudw3aG5zOhRnzwRK_KmRA#_=_)
 * Here’s what I see:-
    [⌊15-08-2013 21-28-07⌉](http://www.flickr.com/photos/95847635@N07/9517100727/)
 *  Plugin Author [John Eckman](https://wordpress.org/support/users/johneckman/)
 * (@johneckman)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033711)
 * So that would suggest you’ve got some misconfiguration, probably based on having
   first tried WPBook.
 * If you just hover over the “generate access token” link in your WPBook-Lite settings
   page, you should see a link that looks like this:
 * [https://www.facebook.com/dialog/oauth?client_id=XXXXXXXX&redirect_uri=%5Byourblogurl%5D%3Fwpbook=oauth&scope=read_stream,publish_stream,manage_pages,user_groups](https://www.facebook.com/dialog/oauth?client_id=XXXXXXXX&redirect_uri=%5Byourblogurl%5D%3Fwpbook=oauth&scope=read_stream,publish_stream,manage_pages,user_groups)
 * Does yours have a different “redirect_uri” that points somewhere else?
 * My guess is that your Facebook application is still set to be an “App on Facebook”
   when it should now be “Website with Facebook login”
 * You’ll just put your blog url in for “Site url” on the “Website with Facebook
   login” section and make sure the “App on Facebook” section is not filled out
 *  Plugin Author [John Eckman](https://wordpress.org/support/users/johneckman/)
 * (@johneckman)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033713)
 * To be clear, I’m talking about the settings for the app you created in Facebook,
   at [https://developers.facebook.com/apps/](https://developers.facebook.com/apps/)–
   go into edit the app you created
 *  Thread Starter [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033715)
 * OK, you are correct in that I still had the “App on Facebook” settings. I’ve 
   taken those out, leaving just the Website with Facebook option enabled.
 * The redirect_uri is correct.
 * I’ve removed the app from my own privacy settings so that I could go through 
   the re-generation of an access token. I click on Generate an Access token, follow
   the prompts on Facebook to allow the app to have public access, authority to 
   write etc…, and then it takes me back to my website where I end up with absolutely
   nothing in the browser window, and the following URL:-
 * [http://mywebdomain.com/?wpbook=oauth&code=AQAgw3Z8YFN9Pox5TJyUpC1Fikpm8YCAkUOOCLonLR8jIaE06P-Bd1o5hTYqyF3uNf1FA66tV-Bi62cjjlrrI9JpfJk9X2LY4TH-hMO_HXEhT3jEc_6fwufsgMlAsxPr4sr88N4xa0a_w_VjzCeZai_xWPBT4SnugalKmRBbFvU_A268dUJ9I-Ql4m3cCEbNmKwyEXYTsyNyNn4V1tdd5qXM5T_hIH1vCbKMzYDGxCZ1r1Kj5hBu4bPF3-GTcHtXYUEYH0ZmZLKPpbYkjagRMvNeLQI73n7yFGxqbFlPOU1gskPTMC7zWBoJvUFG7NAoZmw#_=_](http://mywebdomain.com/?wpbook=oauth&code=AQAgw3Z8YFN9Pox5TJyUpC1Fikpm8YCAkUOOCLonLR8jIaE06P-Bd1o5hTYqyF3uNf1FA66tV-Bi62cjjlrrI9JpfJk9X2LY4TH-hMO_HXEhT3jEc_6fwufsgMlAsxPr4sr88N4xa0a_w_VjzCeZai_xWPBT4SnugalKmRBbFvU_A268dUJ9I-Ql4m3cCEbNmKwyEXYTsyNyNn4V1tdd5qXM5T_hIH1vCbKMzYDGxCZ1r1Kj5hBu4bPF3-GTcHtXYUEYH0ZmZLKPpbYkjagRMvNeLQI73n7yFGxqbFlPOU1gskPTMC7zWBoJvUFG7NAoZmw#_=_)
 *  Plugin Author [John Eckman](https://wordpress.org/support/users/johneckman/)
 * (@johneckman)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033716)
 * Ok, so at the point that you come back to your own site with that code, you should
   be seeing in the browser:
 * Succeeded in saving Access Token Return to your blog\nSucceeded in saving new
   extended Access Token Return to your blog
 * (Yes, it isn’t pretty, but that is what it currently looks like). The “Return
   to your blog” are links.
 * The question is why your blog isn’t properly processing the code from Facebook–
   and seems to be dying before it even outputs anything.
 * This could be a question of plugin conflicts, or Facebook library conflicts, 
   or server configuration.
 * Do you have access to the PHP Error log for your domain? If so, that might hold
   the necessary clue to what’s going wrong.
 * Otherwise, can you try turning off other plugins (except Wpbook lite of course)
   and trying without them enabled? That might help ID the conflict if that is what
   it is.
 *  Thread Starter [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033717)
 * I do have access to the error logs, and am literally on to my hosting provider(
   hostgator) as I type this, to see if they can point out anything.
 *  Thread Starter [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033719)
 * Hi John. I’ve seen an entry in the Raw access logs (not the error logs) on my
   hosting:-
 *     ```
       <em>My IP address</em> - - [16/Aug/2013:10:14:21 -0500] "GET /?wpbook=oauth&code=AQAMM44kU2bZgS5Emzio1K4cVwbiHQ_jvqt5zvfyGpoKST5vKjKS8dT7WsGM4QFsLfqMI_KFghlGXjw3sJChLd4sIYx6v9fEwIxqKa6M_k-q1ya1kVrJJjXQg2BNIqZSwNm4yT6IhJfWqlS3CRKdVJZaXrGZ-ui6sGLJNKpwMbFKnlrQ5vRY7tc1wKDdbE-wGXfzEEfLJHposCSNnjyD9EFKqOuhTUaNrsGe2NyxAaM0AG0_8pYC0okP60qhmK1N2nY6cCkbHBzDZWpePS3D8H_t5dvK8PZ9pr5FF5uzy_q8WfQqhYdMGQ-KTyvrKFs-UqI HTTP/1.1" <strong>414</strong> - "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)"
       ```
   
 * Code 414 makes it look like the URL is too long, and my hosting provider suggested
   using POST instead of GET. Is that configured in your plugin?
 *  Thread Starter [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033725)
 * Ah-ha. I turned off ALL plugins except for WPBook Lite, and got a message saying
   that the access token had been saved. I will keep repeating this after enabling
   each plugin to see what one is causing the conflict.
 *  Thread Starter [chrismillard](https://wordpress.org/support/users/chrismillard/)
 * (@chrismillard)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033727)
 * Found it! Better WP Security is blocking it. I can re-activate Better WP Security
   after generating the access token and it then everything works OK – it just needs
   disabling during the access token generation 🙂
 *  Plugin Author [John Eckman](https://wordpress.org/support/users/johneckman/)
 * (@johneckman)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033730)
 * Interesting. Of course my test blog for wpbook-lite is one of the few on which
   I **don’t** run Better WP Security.
 * There are two things it might be doing that Better WP Security may not like:
 * 1. Making remote requests to Facebook from the server – using [http://codex.wordpress.org/Function_Reference/wp_remote_request](http://codex.wordpress.org/Function_Reference/wp_remote_request)
 * 2. Using the query_vars filter and parse_request to get data out of the code 
   Facebook returns on the redirect string.
 * I *believe* the way I’m doing both of these is pretty WordPress standard, but
   maybe I’ll setup a copy with Better WP Security and see if I can find where the
   issue is.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Problem generating access token’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpbook-lite_eeeeee.svg)
 * [WPBook Lite](https://wordpress.org/plugins/wpbook-lite/)
 * [Support Threads](https://wordpress.org/support/plugin/wpbook-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpbook-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpbook-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpbook-lite/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [John Eckman](https://wordpress.org/support/users/johneckman/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/problem-generating-access-token/#post-4033730)
 * Status: resolved