<commit_before># Passport-Anonymous

[Passport](http://passportjs.org/) strategy for anonymous authentication.

This module lets you provide anonymous authentication in your Node.js
applications.  By plugging into Passport, anonymous authentication can be easily
and unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Installation

    $ npm install passport-anonymous

## Usage

#### Configure Strategy

The anonymous authentication strategy passes authentication for a request,
with `req.user` remaining `undefined`.

    passport.use(new AnonymousStrategy());

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'anonymous'` strategy, to
pass authentication of a request.  This is typically used alongside a strategy
that verifies credentials, as a fallback for routes that prefer authentication
but can also respond to unauthenticated requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.post('/hello', 
      passport.authenticate(['basic', 'anonymous'], { session: false }),
      function(req, res) {
        if (req.user) {
          res.json({ name: req.user.username });
        } else {
          res.json({ anonymous: true });
        }
      });

## Examples

For a complete, working example, refer to the [login example](https://github.com/jaredhanson/passport-anonymous/tree/master/examples/basic).

## Tests

    $ npm install --dev
    $ make test

[![Build Status](https://secure.travis-ci.org/jaredhanson/passport-anonymous.png)](http://travis-ci.org/jaredhanson/passport-anonymous)

## Credits

  - [<NAME>](http://github.com/jaredhanson)

## License

(The MIT License)

Copyright (c) 2011 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<commit_msg>Update README.<commit_after># Passport-Anonymous

[Passport](http://passportjs.org/) strategy for anonymous authentication.

This module lets you provide anonymous authentication in your Node.js
applications.  By plugging into Passport, anonymous authentication can be easily
and unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install

    $ npm install passport-anonymous

## Usage

#### Configure Strategy

The anonymous authentication strategy passes authentication for a request,
with `req.user` remaining `undefined`.

    passport.use(new AnonymousStrategy());

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'anonymous'` strategy, to
pass authentication of a request.  This is typically used alongside a strategy
that verifies credentials, as a fallback for routes that prefer authentication
but can also respond to unauthenticated requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.post('/hello', 
      passport.authenticate(['basic', 'anonymous'], { session: false }),
      function(req, res) {
        if (req.user) {
          res.json({ name: req.user.username });
        } else {
          res.json({ name: 'anonymous' });
        }
      });

## Examples

For a complete, working example, refer to the [login example](https://github.com/jaredhanson/passport-anonymous/tree/master/examples/basic).

## Tests

    $ npm install --dev
    $ make test

[![Build Status](https://secure.travis-ci.org/jaredhanson/passport-anonymous.png)](http://travis-ci.org/jaredhanson/passport-anonymous)

## Credits

  - [<NAME>](http://github.com/jaredhanson)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2012-2013 <NAME> <[http://jaredhanson.net/](http://jaredhanson.net/)>
{'fraction_non_alphanumeric': 0.10413188647746244, 'fraction_numerical': 0.0025041736227045075, 'mean_word_length': 4.296132596685083, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1903384', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1266, 'n_words': 475}