server | client

OAuth Test Server

Instructions for Use

This is a test server with a predefined static set of keys and tokens, you can make your requests using them to test your code (and mine ;)).

Your Consumer Key / Secret

Use this key and secret for all your requests.

Getting a Request Token

A successful request will return the following with new parameters returned in OAuth 2008.1:

oauth_token=requestkey&oauth_token_secret=requestsecret&oauth_expires_in=3600

An unsuccessful request will attempt to describe what went wrong using oauth_problem codes.

Example

http://api.mh-freya-game.com/oauth/example/request_token.php?oauth_version=1.0&oauth_nonce=18dc704cdc32cae90c6f48cddb307b3b&oauth_timestamp=1752395324&oauth_consumer_key=key&oauth_signature_method=RSA-SHA1&oauth_signature=MvHSVmEXCMZNsOi%2BSmwU%2B%2BWXjfBLcYHmNuqIjx7YtsnNXPMEx08s2Et%2FOwfkqErRJ72%2FrWWAiIwj7dZjXNgXDWWWUmzKEXrGU%2BuWldawak2T1t8OvM7EpjBjR871jVj%2FPH0hQT83rX0iAuRYa7t9U6hoFyDM5rvC3ZMURwYrZTQ%3D

New in OAuth 2008.1

Getting an Access Token

The Request Token provided above is already authorized, you may use it to request an Access Token right away.

A successful request will return the following with new parameters returned in OAuth 2008.1:

oauth_token=accesskey&oauth_token_secret=accesssecret&oauth_session_handle=sessionhandle&oauth_expires_in=3600&oauth_authorization_expires_in=3600

An unsuccessful request will attempt to describe what went wrong.

Example

http://api.mh-freya-game.com/oauth/example/access_token.php?oauth_version=1.0&oauth_nonce=79877848b9ea8dd7f9e36e1047b9ca01&oauth_timestamp=1752395324&oauth_consumer_key=key&oauth_token=requestkey&oauth_signature_method=RSA-SHA1&oauth_signature=p%2BXQfI0r3FR%2BOHaA6g6spbQ6wVgXVBUXmkdDolP6I3Rsvgj9wjlhxFmhrWJcQpaIaHxl2BoxI%2B2FuWRmmfE2PHCBLv%2Fpmz%2BIuiCENipB8fDEFFv%2BBhnuz5YcwEsgbLy5rYQolb%2Fp%2B01eK9K7Rflqg2d%2FipGJn6BwmjFWtjbG4fA%3D

New in OAuth 2008.1

New in OAuth 2008.1: Renewing an Access Token

A feature new in OAuth 2008.1 is access token renewal. When access tokens expire, you must acquire a new token using the renewal api.

A successful request will return the following:

oauth_token=accesskey&oauth_token_secret=accesssecret&oauth_session_handle=sessionhandle&oauth_expires_in=3600&oauth_authorization_expires_in=3600

An unsuccessful request will attempt to describe what went wrong.

Example

http://api.mh-freya-game.com/oauth/example/renew_access_token.php?oauth_version=1.0&oauth_nonce=6a521db989c69e7999304f22d228f252&oauth_timestamp=1752395324&oauth_consumer_key=key&oauth_token=accesskey&oauth_session_handle=sessionhandle&oauth_signature_method=RSA-SHA1&oauth_signature=WSyvhVLtTo95IRlMemQ0y0ogz%2FlQ3uWR%2BaQoarqtAKNV2JXTlo5ayMp8Qbb8A7iDank31CcNS1P525fxGB0UE0rrmkXboO%2B9e%2FfpbA2hfZFU8lXn%2FCULFIgtAkS8elHihPQnzxPy21QqLvz6Fyifbn7VDt0nW5zzm9vkvdanltA%3D

Making Authenticated Calls

Using your Access Token you can make authenticated calls.

A successful request will echo the non-OAuth parameters sent to it, for example:

method=foo&bar=baz

An unsuccessful request will attempt to describe what went wrong.

Example

http://api.mh-freya-game.com/oauth/example/echo_api.php?oauth_version=1.0&oauth_nonce=3f733f0c238db45e934e5ceadf257ce5&oauth_timestamp=1752395324&oauth_consumer_key=key&method=foo%2520bar&bar=baz&oauth_token=accesskey&oauth_signature_method=RSA-SHA1&oauth_signature=CvaVPqHwyU8MVBII34L7M582SYwiZG6tFM8UsjSFLa5NvTtpi%2Fxd4WtfTLR0W%2FlJ%2FuWGoJeF1SlT1txc2GnWRE77TYulguQkEiMFKJufitUulWyu3UYoRus1DEOnnN%2BJka7xcdcBdI4SV8lhlsh4gR58TpBcH277hkY5v98iZd8%3D

Currently Supported Signature Methods

Current signing method is: RSA-SHA1

-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALRiMLAh9iimur8V
A7qVvdqxevEuUkW4K+2KdMXmnQbG9Aa7k7eBjK1S+0LYmVjPK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4S0IFzEURkV1wp/IpH7kH41Etb
mUmrXSwfNZsnQRE5SYSOhh+LcK2wyQkdgcMv11l4KoBkcwIDAQABMA0GCSqGSIb3
DQEBBQUAA4GBAGZLPEuJ5SiJ2ryq+CmEGOXfvlTtEL2nuGtr9PewxkgnOjZpUy+d
4TvuXJbNQc8f4AMWL/tO9w0Fk80rWKp9ea8/df4qMq5qlFWlx6yOLQxumNOmECKb
WpkUQDIDJEoFUzKMVuJf4KO/FJ345+BNLGgbJ6WujreoM1X/gYfdnJ/J
-----END CERTIFICATE-----

Further Resources

There is also a test client 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/