- Notifications
You must be signed in to change notification settings - Fork108
JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
License
bytespider/jsOAuth
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This library is old and unmaintained. There are far better and more modern alternatives.
jsOAuth is a javascript library implementing the OAuth protocol. jsOAuth aims toform 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 usein Adobe AIR, Appcelerator Titanium and PhoneGAP.In fact, anywhere that javascript can be used and has cross-domainXMLHttpRequests.For security reasons jsOAuth doesn't run in the browser. Browsers are onlymentioned 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 moreinformation.
Find the API reference and tutorials on theDocumentation site.For recipes on ways to get things working with jsOAuth, try therecipes page.If you need more help or discussion, try theGoogle jsOAuth Group.
Download the minified library from thedistribution 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 isdone, 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 javscriptframework such as jQuery.
On Node you'll need to install the XHR module withnpm install xhr
Please let me know if jsOAuth doesn't work for you or if your applicationrequires something jsOAuth doesn't currently support. I'm always happy to hear yoursuggestions.feedback@bytespider.eu
If you like jsOAuth and want to see new features,please donate.
- Example: Boilerplate for PIN based authentication in javascript
- Tutorial: Titanium & jsOAuth - Part 1
- Tutorial: Titanium & jsOAuth - Part 2
- Tutorial: OAuth and PIN based authorization in Javascript
- Tutotial: Twitter: jsOAuth and Child Browser plugin: non-PIN OAuth access!
- Snippet: A simple example of PIN-based oauth flow with Twitter and jsOAuth by @funkatron
- Snippet: How to upload files using jsOAuth and FormData by @lukaszkorecki
If you have a tutorial you think should be included here, please email me with links.
To start developing, clone this repository and initialise the dependent git submodules by executing the following commands:
git submodule initgit submodule update
To build the entire library typemake
from the command line.
To build just the W3C compatible version, typemake jsoauth
from the command line.To build just CommonJS/Node.JS compatible module typemake commonjs
from the command line.
All files are compiled into the dist directory.
To start over once you have already built a copy, typemake clean
to deleteall built distribution files
Please report all issues on the GitHubissue tracker for jsOauth.
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
- Rob Griffiths (rob AT bytespider DOT eu)@bytespider
About
JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors14
Uh oh!
There was an error while loading.Please reload this page.