Here are test cases for OAuth algorithms.
To discuss this page, please use the Test Cases thread in the Google Group OAuth.
Parameter Encoding (section 5.1)
In this table, U+xxxx means the character whose Unicode code point is xxxx (in hexadecimal notation).
parameter name or value | encoded |
abcABC123 | abcABC123 |
-._~ | -._~ |
% | %25 |
&=* | %26%3D%2A |
U+000A (LF) | %0A |
U+0020 (space) | %20 |
U+007F | %7F |
U+0080 | %C2%80 |
U+3001 | %E3%80%81 |
Authorization Header (section 5.4.1)
Normalize Request Parameters (section 9.1.1)
In this table, parameters are shown as a document of MIME type application/x-www-form-urlencoded that conforms to HTML 4.01 section 17.13.4.1.
parameters | normalized |
name | name= |
a=b | a=b |
a=b&c=d | a=b&c=d |
a=x!y&a=x+y | a=x%20y&a=%21y |
x!y=a&x=a | x=a&x%21y=a |
Concatenate Request Elements (section 9.1.2)
In this table, parameters are shown as a document of MIME type application/x-www-form-urlencoded that conforms to HTML 4.01 section 17.13.4.1, with some white space inserted for legibility.
HTTP request method | HTTP URL | parameters | Consumer Secret | Token Secret | Base String |
GET | http://example.com | n=v | cs | ts | GET&http%3A%2F%2Fexample.com&n%3Dv&cs&ts |
POST | https://photos.example.net/request_token | oauth_version=1.0&oauth_consumer_key=dpf43f3p2l4k3l03 &oauth_timestamp=1191242090&oauth_nonce=hsu94j3884jdopsl &oauth_signature_method=PLAINTEXT&oauth_signature=ignored | kd94hf93k423kf44 | | POST&https%3A%2F%2Fphotos.example.net%2Frequest_token&oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dhsu94j3884jdopsl%26oauth_signature_method%3DPLAINTEXT%26oauth_timestamp%3D1191242090%26oauth_version%3D1.0&kd94hf93k423kf44& |
GET | http://photos.example.net/photos | file=vacation.jpg&size=original &oauth_version=1.0&oauth_consumer_key=dpf43f3p2l4k3l03 &oauth_token=nnch734d00sl2jdk &oauth_timestamp=1191242096&oauth_nonce=kllo9940pd9333jh &oauth_signature=ignored&oauth_signature_method=HMAC-SHA1 | kd94hf93k423kf44 | pfkkdhi9sl3r4s00 | GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal&kd94hf93k423kf44&pfkkdhi9sl3r4s00 |
HMAC-SHA1 (section 9.2)
Consumer Secret | Token Secret | Base String | Signature |
cs | | bs | egQqG5AJep5sJ7anhXju1unge2I= |
cs | ts | bs | VZVjXceV7JgPq/dOTnNmEfO0Fv8= |
kd94hf93k423kf44 | pfkkdhi9sl3r4s00 | GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal&kd94hf93k423kf44&pfkkdhi9sl3r4s00 | Gcg/323lvAsQ707p+y41y14qWfY= |
RSA-SHA1 (section 9.3)
Comments (0)
You don't have permission to comment on this page.