jsOAuth

JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.

Github星跟蹤圖

[Abandoned]

This library is old and unmaintained. There are far better and more modern alternatives.

jsOAuth - JavaScript OAuth library

jsOAuth is a javascript library implementing the OAuth protocol. jsOAuth aims to
form the basis of custom clients such as Twitter and Yahoo.

Written in JavaScript, jsOAuth aims to be a fully featured open source OAuth library for use
in Adobe AIR, Appcelerator Titanium and PhoneGAP.
In fact, anywhere that javascript can be used and has cross-domain
XMLHttpRequests. For security reasons jsOAuth doesn't run in the browser. Browsers are only
mentioned here for running the test suite.
If you need jsOAuth in the browser, write an extension.

Released under the MIT. Please see LICENSE in the project root folder for more
information.

Documentation

Find the API reference and tutorials on the Documentation site.
For recipes on ways to get things working with jsOAuth, try the recipes page.
If you need more help or discussion, try the Google jsOAuth Group.

Usage

Download the minified library from the distribution directory and include it in your html.

<script type="text/javascript" src="library/jsOAuth-1.3.7.min.js"></script>

This gives you a global OAuth object for you to set up and make requests with.
Setting it up is simple.

<script type="text/javascript">
    var oauth, options;

    options = {
        enablePrivilege: true,
        consumerKey: 'ba9df9055c77f338',
        consumerSecret: '846ffe1ec3b18989e73fe7fff833'
    };

    oauth = OAuth(options);
</script>

Note: EnablePrivilege lets you test jsOAuth in Firefox 3, Firefox >= 5 doesn't work
You can test in chrome using the following commandline on OSX /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --allow-file-access-from-files --allow-file-access --user-data-dir=~/chrome-test/ spec/runner.html
On Ubuntu try /opt/google/chrome/google-chrome --disable-web-security --allow-file-access-from-files --allow-file-access --user-data-dir=~/chrome-test/ spec/runner.html

You'll need to replace the consumer key and secret with your own. Once that is
done, you can make your authenticated 2-legged request.

<script type="text/javascript">
    oauth.get('http://oauth-sandbox.sevengoslings.net/two_legged', function (data) {
        alert(data);
    });
</script>

Hopefully the syntax will look familier to you, if you've used any kind of javscript
framework such as jQuery.

Node.js

On Node you'll need to install the XHR module with npm install xhr

Please let me know if jsOAuth doesn't work for you or if your application
requires something jsOAuth doesn't currently support. I'm always happy to hear your
suggestions. feedback@bytespider.eu

If you like jsOAuth and want to see new features, please donate.

Further reading and tutorials

Applications

Libraries

If you have a tutorial you think should be included here, please email me with links.

Building

To start developing, clone this repository and initialise the dependent git submodules by executing the following commands:

git submodule init
git submodule update

To build the entire library type make from the command line.

To build just the W3C compatible version, type make jsoauth from the command line.
To build just CommonJS/Node.JS compatible module type make commonjs from the command line.

All files are compiled into the dist directory.

To start over once you have already built a copy, type make clean to delete
all built distribution files

Issues

Please report all issues on the GitHub issue tracker for jsOauth.

Testing

To test I use Google Chrome

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --allow-file-access-from-files --allow-file-access spec/runner.html

Authors

主要指標

概覽
名稱與所有者bytespider/jsOAuth
主編程語言JavaScript
編程語言JavaScript (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2009-11-11 11:15:50
推送於2017-11-30 11:15:11
最后一次提交2017-11-30 11:15:09
發布數25
最新版本名稱1.3.7 (發布於 )
第一版名稱0.2 (發布於 )
用户参与
星數551
關注者數24
派生數106
提交數625
已啟用問題?
問題數36
打開的問題數6
拉請求數15
打開的拉請求數1
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?