title: Facebook Login using Jmeter
body: <p>I want to do a load test my Heroku application using Jmeter.
  To access the functionality of the application, I need to login through Facebook first. 
  I tried with browser recording using proxy server. But the problem is the code parameter  (response_type) returned by facebook  is hard coded in the callback URI. So its giving exception (Code expired exception) while running the Jmeter script.   </p>
  
  <p>I am able to view the code in response header of <code>https://www.facebook.com/dialog/permissions.request</code> URL. So I need to grab this code from this header dynamically and put in the code parameter of callback URL. </p>
  
  <p>For this I am using <strong>Regular Expression Extractor</strong> in Jmeter under <code>/dialog/permissions.request</code> URL. </p>
  
  <p>My response header looks like below:</p>
  
  <pre><code>Cache-Control   private, no-cache, no-store, must-revalidate
  Date            Wed, 26 Dec 2012 13:37:17 GMT
  Expires         Sat, 01 Jan 2000 00:00:00 GMT
  Location        http://myapplication.herokuapp.com/oauth/authenticate/facebook?code=SOME-CODE
  P3P CP="Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p"
  </code></pre>
  
  <p>I want to extract this <code>code=some code</code> and put it in the next URL using regular expression extractor.</p>