ohauth
![](http://ci.testling.com/osmlab/ohauth.png)
A most-of-the-way OAuth 1.0 client implementation in Javascript. Meant to be
an improvement over the default linked one
because this uses idiomatic Javascript.
This includes Paul Johnston's venerable implementation of SHA1.
If you use this on a server different from the one authenticated against,
you'll need to enable and use CORS
for cross-origin resources. CORS is not available in IE before version IE10.
Compatibility
- OpenStreetMap full & tested with iD
- GitHub - partial, full flow is not possible because
access_token
API is not CORS-enabled
API
ohauth.timestamp();
ohauth.nonce();
ohauth.signature({
oauth_consumer_key: '...',
oauth_signature_method: '...',
oauth_timestamp: '...',
oauth_nonce: '...'
});
ohauth.xhr(method, url, auth, data, options, callback);
{ header: { 'Content-Type': 'text/xml' } }
ohauth.xhr('POST', url, o, null, {}, function(xhr) {
});
ohauth.qsString({ foo: 'bar' });
ohauth.stringQs('foo=bar');