Home > Facebook SDK > New way to create test users in Facebook

New way to create test users in Facebook


As mentioned in the Facebook developer docs, test users can only be created using a call to the Graph API.
As described in my previous Facebook article, a dedicated webpage was available at the time to create test users, however, that page has been brought offline. 

You can create a test user associated with a particular app using the Graph API with your app access token.


However, before we’ll be able call this API, we first need to retrieve an Access Token for our application.

Application Access Token

Before you get started, you might want to startup a text editor to copy paste some of these URLs and values (application ID, application secret, access token) as you’ll need to construct a lot of URLS that include these values.

In order to get an Access Token for our application, we need to know our Application Secret.

The first thing we’ll need is our Facebook Application ID. The Application ID is a unique identifier that you received while creating your application.
We’ can use the URL below to retrieve our Application Secret. Fill in your Application ID in the following URL to goto your Facebook App page and retrieve the Application Secret.


Now that we have the Application ID and the Application Secret, we can retrieve an access token for our application. In order to do that, we need to call the following URL with our Application ID and Application Secret.


You’ll receive the following response:


Creating the test user

Now that we have our access token, we can do the task at hand, and use the Graph API to call our test-user.


With everything filled in, your request should look resemble something like this:


If all went well, you should get a response similar to this:

   "id": "10000123432213",
   "access_token": "109636235495125|2.DFDGayE7X1s9ft_N7k94_E__.3600.1304802000.0-100002332671439|HhwACDVFeNhQ_UV0tQY0mUzkvLs",
   "login_url": "https://www.facebook.com/platform/test_account_login.php?user_id=10000123432213&n=R3feV4O7YrlIb0n",
   "email": "some_one\u0040tfbnw.net",
   "password": "3123123123133"

This basically means your test user has been created, and you can login to Facebook with this account. Use the email address (some_one@tfbnw.net) to login, and the password provided in the response.

You can change the password to a more convenient value for testing.


Categories: Facebook SDK Tags: ,
  1. ramesh
    September 26th, 2011 at 09:53 | #1

    what you mean by accesstoken in facebook

  2. Paul
    December 8th, 2011 at 03:45 | #2

    Hi, thanks for the post/tutorial. I followed the steps and at the end I got a response like the one you you said should be received but I cannot log in with it. Thanks for any input

  3. willy
    February 27th, 2012 at 02:21 | #3

    Thanks for this tutorial. I could create a test user, but I couldn’t login with Android. Is there any trick to do that? Thanks again

  1. No trackbacks yet.