The first part of the above code is configuration information that should be updated accordingly to match your needs. The user ID, consumer key, and consumer secret key are all generated during the registration process on the server.
As described during the introduction to a three-legged OAuth server, the following process is performed in the above test file:
Ask for a request token (via the request_token.php file) with the consumer key
Upon receiving the token, redirect the user to the login page passing the token and callback URL via URL parameters
Once the user is logged in, they are redirected back to the above test page. The test page takes the token and asks for an access token (via the access_token.php file)
Upon success, the necessary OAuth information is returned and the test file performs a secure request to test_request.php.
If all goes well a basic “Hello 1” will be displayed.