A successful login with JMeter requires the following steps:
1. Set JMeter as a proxy and record your log-in flow. (Click here for help)
2. Identify two locations:
-- The request that gets the login form
-- The request that posts the login credentials.
3. The response from the GET request will contain tokens which need to be extracted and sent as a parameter in the POST request.
-- Add a Regular Expression Extractor to store these tokens. (Click here for help)
-- Include these tokens as parameters in the POST request.
See the 2nd video below for an example.
Here is a video showing the process from start to finish:
And another video that deals with dynamic authentication tokens (starting at 5:30):