<commit_before>authom
=======

authom is an authentication library for node.js. It unifies authentication APIs for multiple services into a single EventEmitter, and works with both the built-in node.js HTTP module and as an Express/Connect app.

authom was designed to solve one problem and solve it well. It has an intuitive node.js-like API, no required dependencies, and doesn't force any particular persistence, session, or middleware approaches on you.

Example
-------

For the built-in node.js HTTP module:

```javascript
// Like socket.io, authom will intercept requests
// for you to help keep your routes clean.

var server = require("http").createServer()
  , authom = require("authom")

server.on("request", function() {
  // your usual server logic
})

// create servers for the services you'll be using
authom.createServer({ /* facebook credentials */ })
authom.createServer({ /* github credentials */ })
authom.createServer({ /* google credentials */ })
authom.createServer({ /* twitter credentials */ })
// ... et cetera

authom.on("auth", function(req, res, data) {
  // called when a user is authenticated on any service
})

authom.on("error", function(req, res, data) {
  // called when an error occurs during authentication
})

authom.listen(server)
server.listen(8000)
```

For Express/Connect:

```javascript
var express = require("express")
  , app = express()
  , authom = require("authom")

// create servers for the services you'll be using
authom.createServer({ /* facebook credentials */ })
authom.createServer({ /* github credentials */ })
authom.createServer({ /* google credentials */ })
authom.createServer({ /* twitter credentials */ })
// ... et cetera

authom.on("auth", function(req, res, data) {
  // called when a user is authenticated on any service
})

authom.on("error", function(req, res, data) {
  // called when an error occurs during authentication
})

app.get("/auth/:service", authom.app)

app.listen(8000)
```

Supported services
------------------

<img src="https://github.com/jed/authom/raw/master/lib/assets/37signals.ico" style="vertical-align:middle"> 37signals (by [nodebiscut](https://github.com/nodebiscut))

<img src="https://github.com/jed/authom/raw/master/lib/assets/bitbucket.png" style="vertical-align:middle" width="16" height="16"> Bitbucket (by [aslakhellesoy](https://github.com/aslakhellesoy))

<img src="https://github.com/jed/authom/raw/master/lib/assets/dropbox.ico" style="vertical-align:middle"> Dropbox (by [cartuchogl](https://github.com/cartuchogl))

<img src="https://github.com/jed/authom/raw/master/lib/assets/dwolla.ico" style="vertical-align:middle"> Dwolla (by [nodebiscut](https://github.com/nodebiscut))

<img src="https://github.com/jed/authom/raw/master/lib/assets/facebook.ico" style="vertical-align:middle"> Facebook (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/fitbit.ico" style="vertical-align:middle"> Fitbit (by [pspeter3](https://github.com/pspeter3))

<img src="https://github.com/jed/authom/raw/master/lib/assets/foodspotting.ico" style="vertical-align:middle"> Foodspotting (by [kimtaro](https://github.com/kimtaro))

<img src="https://github.com/jed/authom/raw/master/lib/assets/foursquare.ico" style="vertical-align:middle"> Foursquare (by [nodebiscut](https://github.com/nodebiscut))

<img src="https://github.com/jed/authom/raw/master/lib/assets/github.ico" style="vertical-align:middle"> GitHub (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/google.ico" style="vertical-align:middle"> Google (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/gowalla.ico" style="vertical-align:middle"> Gowalla (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/instagram.ico" style="vertical-align:middle"> Instagram (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/linkedin.ico" style="vertical-align:middle"> LinkedIn (by [shinecita](https://github.com/shinecita))

<img src="https://github.com/jed/authom/raw/master/lib/assets/meetup.ico" style="vertical-align:middle"> Meetup (by [softprops](https://github.com/softprops))

<img src="https://github.com/jed/authom/raw/master/lib/assets/reddit.png" style="vertical-align:middle"> Reddit (by [avidw](https://github.com/avidw))

<img src="https://github.com/jed/authom/raw/master/lib/assets/soundcloud.ico" style="vertical-align:middle"> SoundCloud (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/trello.ico" style="vertical-align:middle"> Trello (by [falexandrou](https://github.com/falexandrou))

<img src="https://github.com/jed/authom/raw/master/lib/assets/twitter.ico" style="vertical-align:middle"> Twitter (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/vkontakte.ico" style="vertical-align:middle"> Vkontakte (by [molforp](https://github.com/molforp))

<img src="https://github.com/jed/authom/raw/master/lib/assets/windowslive.ico" style="vertical-align:middle"> Windows Live (by [jed](https://github.com/jed))

<img src="https://github.com/jed/authom/raw/master/lib/assets/ninjablocks.ico" style="vertical-align:middle"> Ninja Blocks (by [thatguydan](https://github.com/thatguydan))

Installation and Setup
----------------------

To install, enter:

    $ npm install authom

To see the demo, enter:

    $ npm start authom
<commit_msg>update favicon hrefs for README<commit_after>authom
=======

authom is an authentication library for node.js. It unifies authentication APIs for multiple services into a single EventEmitter, and works with both the built-in node.js HTTP module and as an Express/Connect app.

authom was designed to solve one problem and solve it well. It has an intuitive node.js-like API, no required dependencies, and doesn't force any particular persistence, session, or middleware approaches on you.

Example
-------

For the built-in node.js HTTP module:

```javascript
// Like socket.io, authom will intercept requests
// for you to help keep your routes clean.

var server = require("http").createServer()
  , authom = require("authom")

server.on("request", function() {
  // your usual server logic
})

// create servers for the services you'll be using
authom.createServer({ /* facebook credentials */ })
authom.createServer({ /* github credentials */ })
authom.createServer({ /* google credentials */ })
authom.createServer({ /* twitter credentials */ })
// ... et cetera

authom.on("auth", function(req, res, data) {
  // called when a user is authenticated on any service
})

authom.on("error", function(req, res, data) {
  // called when an error occurs during authentication
})

authom.listen(server)
server.listen(8000)
```

For Express/Connect:

```javascript
var express = require("express")
  , app = express()
  , authom = require("authom")

// create servers for the services you'll be using
authom.createServer({ /* facebook credentials */ })
authom.createServer({ /* github credentials */ })
authom.createServer({ /* google credentials */ })
authom.createServer({ /* twitter credentials */ })
// ... et cetera

authom.on("auth", function(req, res, data) {
  // called when a user is authenticated on any service
})

authom.on("error", function(req, res, data) {
  // called when an error occurs during authentication
})

app.get("/auth/:service", authom.app)

app.listen(8000)
```

Supported services
------------------

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/37signals.ico" style="vertical-align:middle"> 37signals (by [nodebiscut](https://github.com/nodebiscut))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/bitbucket.png" style="vertical-align:middle" width="16" height="16"> Bitbucket (by [aslakhellesoy](https://github.com/aslakhellesoy))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/dropbox.ico" style="vertical-align:middle"> Dropbox (by [cartuchogl](https://github.com/cartuchogl))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/dwolla.ico" style="vertical-align:middle"> Dwolla (by [nodebiscut](https://github.com/nodebiscut))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/facebook.ico" style="vertical-align:middle"> Facebook (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/fitbit.ico" style="vertical-align:middle"> Fitbit (by [pspeter3](https://github.com/pspeter3))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/foodspotting.ico" style="vertical-align:middle"> Foodspotting (by [kimtaro](https://github.com/kimtaro))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/foursquare.ico" style="vertical-align:middle"> Foursquare (by [nodebiscut](https://github.com/nodebiscut))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/github.ico" style="vertical-align:middle"> GitHub (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/google.ico" style="vertical-align:middle"> Google (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/gowalla.ico" style="vertical-align:middle"> Gowalla (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/instagram.ico" style="vertical-align:middle"> Instagram (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/linkedin.ico" style="vertical-align:middle"> LinkedIn (by [shinecita](https://github.com/shinecita))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/meetup.ico" style="vertical-align:middle"> Meetup (by [softprops](https://github.com/softprops))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/reddit.png" style="vertical-align:middle"> Reddit (by [avidw](https://github.com/avidw))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/soundcloud.ico" style="vertical-align:middle"> SoundCloud (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/trello.ico" style="vertical-align:middle"> Trello (by [falexandrou](https://github.com/falexandrou))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/twitter.ico" style="vertical-align:middle"> Twitter (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/vkontakte.ico" style="vertical-align:middle"> Vkontakte (by [molforp](https://github.com/molforp))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/windowslive.ico" style="vertical-align:middle"> Windows Live (by [jed](https://github.com/jed))

<img src="https://raw.githubusercontent.com/jed/authom/raw/master/lib/assets/ninjablocks.ico" style="vertical-align:middle"> Ninja Blocks (by [thatguydan](https://github.com/thatguydan))

Installation and Setup
----------------------

To install, enter:

    $ npm install authom

To see the demo, enter:

    $ npm start authom

{'fraction_non_alphanumeric': 0.17844290353725972, 'fraction_numerical': 0.003159834986395155, 'mean_word_length': 4.922037422037422, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 84, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '391760', 'n_tokens_mistral': 3726, 'n_tokens_neox': 3719, 'n_words': 712}