• This repository has been archived on 10/Apr/2024
  • Stars
    star
    556
  • Rank 80,098 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 15 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

[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. [email protected]

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

More Repositories

1

Meross

Investigating the Meross/Refoss MSS310 Smart Plug and getting these devices to communicate with our private MQTT brokers
JavaScript
112
star
2

DownloadQueue

JavaScript
11
star
3

jsOAuth-Twitter

Twitter client library for jsOAuth
JavaScript
11
star
4

ssim

The structural similarity (SSIM) index is a method for measuring the similarity between two images. http://en.wikipedia.org/wiki/Structural_similarity
JavaScript
11
star
5

downtime

jQuery plugin for customisable timers and timed events
JavaScript
7
star
6

SHA1-Hash

SHA1 / HMAC functions from the jsOAuth library
JavaScript
6
star
7

XML2JSON

A simple XML to JSON transformation tool written in javascript
JavaScript
6
star
8

Javascript-a-Week

Just a collection of useful scripts, a new one every week.
JavaScript
5
star
9

psnr

Peak signal-to-noise ratio http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio
JavaScript
4
star
10

average

The result obtained by adding several amounts together and then dividing this total by the number of amounts; the mean.
JavaScript
3
star
11

covariance

In probability theory and statistics, covariance is a measure of how much two random variables change together. http://en.wikipedia.org/wiki/Covariance
JavaScript
3
star
12

pi_factory

Tools for playing with the Raspberry Pi
Shell
3
star
13

Gravitas

Gravitar component for Appcelerator Titanium
JavaScript
3
star
14

Base64

Base64 encoding function from the jsOAuth library
JavaScript
3
star
15

Incognitus

A shell script for Mac OSX to gain unique incognito sessions. Free of plugins and history.
Shell
3
star
16

LionUI

Creating a OSx Lion style UI in HTML CSS & JavaScript
JavaScript
3
star
17

SimpleScroll

SimpleScroll is an iPhone two finger scroll emulation mapped to one finger. Perfect for those who don't need the complexities of native scroll emulation in their iPhone WebApps
3
star
18

OAuthRequest

OAuth Request signing module
JavaScript
2
star
19

Pipeline

Pipeline is a client-side, open source, document-oriented storage database.
JavaScript
2
star
20

Torque

A library for controlling servos connected to a SSC or Torobot servo controller board. API modelled after Johnny-Five
JavaScript
2
star
21

variance

http://en.wikipedia.org/wiki/Variance
JavaScript
2
star
22

Snow-Globe

iOS 4.2 Snow globe demo
2
star
23

dependency-manager

Simple dependency injection manager
JavaScript
2
star
24

Orka

Identi.ca client for Mac
JavaScript
2
star
25

ios

Objective-C
1
star
26

animation

Simple “class” for frame based animation
JavaScript
1
star
27

jsOAuth-Twitter-test-app

JavaScript
1
star
28

awis-client

PHP package for making requests to Alexa Web Information Service
PHP
1
star
29

food

Recipes
1
star
30

NameSpace

Just another javascript library, except all the components aim for no dependancies and loose coupling
JavaScript
1
star
31

HotKey

Cocoa library for creating global hotkeys in OSX > 10.5 64bit
Objective-C
1
star