hapi-auth-passthrough

1.0.1 • Public • Published

hapi-auth-passthrough

Build Status

Hapi passthrough authentication plugin.

Passthrough authentication

Allow all requests to get successful auth replies, with configurable credentials object from the request.headers.

For example we have following route in a plugin:

 
server.route({
    method: 'POST',
    path: '/admin',
    config: {
        auth: {
            strategy: 'default',
            scope: 'admin'
        }
    }
});
 

However, we're not ready yet on our own (custom) hapi-auth-* plugin or not yet decided which plugin we will use. But we need to test the plugin. Hence, in the test, we can register the hapi-auth-passthrough and have a request object to set the scope for the returned credentials object.

var request = {
    ...
    headers: {
        'Pass-Scope': admin // or for multiple scopes: admin, user, wizard
    }
}

License

MIT

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i hapi-auth-passthrough

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • diorahman