sign_request($sig_method, $test_consumer, NULL); if ($dump_request) { Header('Content-type: text/plain'); print "request url: " . $req_req->to_url(). "\n"; print_r($req_req); exit; } Header("Location: $req_req"); } else if ($action == "authorize") { $callback_url = "$base_url/client.php?key=$key&secret=$secret&token=$token&token_secret=$token_secret&endpoint=" . urlencode($endpoint); $auth_url = $endpoint . "?oauth_token=$token&oauth_callback=".urlencode($callback_url); if ($dump_request) { Header('Content-type: text/plain'); print("auth_url: " . $auth_url); exit; } Header("Location: $auth_url"); } else if ($action == "access_token") { $parsed = parse_url($endpoint); $params = array(); parse_str($parsed['query'], $params); $acc_req = OAuthRequest::from_consumer_and_token($test_consumer, $test_token, "GET", $endpoint, $params); $acc_req->sign_request($sig_method, $test_consumer, $test_token); if ($dump_request) { Header('Content-type: text/plain'); print "request url: " . $acc_req->to_url() . "\n"; print_r($acc_req); exit; } Header("Location: $acc_req"); } ?> OAuth Test Client
server | client

OAuth Test Client

Instructions for Use

This is a test client that will let you test your OAuth server code. Enter the appropriate information below to test.

Note: we don't store any of the information you type in.

Choose a Signature Method

Enter The Endpoint to Test

endpoint:
Note: You can include query parameters in there to have them parsed in and signed too

Enter Your Consumer Key / Secret

consumer key:
consumer secret:
dump request, don't redirect: />
make a token request (don't forget to copy down the values you get)

Enter Your Request Token / Secret

token:
token secret:

Don't forget to update your endpoint to point at the auth or access token url

try to authorize this token:
try to get an access token:

Currently Supported Signature Methods

Current signing method is: get_name() ?>

get_name()) { // passing test_server as a dummy referecne print "
" . $sig_method->fetch_private_cert($test_server). "
\n"; print "
" . $sig_method->fetch_public_cert($test_server) . "
\n"; } ?>

Further Resources

There is also a test server implementation in here.

The code running this example can be downloaded from the PHP section of the OAuth google code project: http://code.google.com/p/oauth/