Skip to content
An express middleware for header based authroization
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
node_modules
test
.gitignore
LICENSE
README.md
express-auth.js
package.json

README.md

express-auth

An express middleware for header based authorization. Handles the sessions seamlessly with any datastore (with correct configuration and driver).

Configuration

    The following configuration options are available. Override the store with your datastore option. Currently configured with mongoDB.
    <pre>
        <code>
            var defaultConfig = {
                secret: '',
                header: 'authorization',
                exclude: [],
                error: new Error('Unauthorized'),
                userIdField: 'userId',
                userIdRequired: true,
                store: {
                    db: 'test',
                    host: 'localhost',
                    port: '27017',
                    username: '',
                    password: '',
                    collection: 'session',
                    w: 1,
                    expiration: 7200
                }
            };
        </code>
    </pre>
Something went wrong with that request. Please try again.