Socket
Socket
Sign inDemoInstall

passport-activedirectory

Package Overview
Dependencies
47
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "passport-activedirectory",
"version": "1.0.0",
"version": "1.0.1",
"description": "Active Directory strategy for passport.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -13,2 +13,3 @@ # passport-activedirectory

#### Setup
```js

@@ -19,2 +20,3 @@ var passport = require('passport')

passport.use(new ActiveDirectoryStrategy({
integrated: false,
ldap: {

@@ -33,3 +35,16 @@ url: 'ldap://my.domain.com',

```
#### Protecting a path
```js
var opts = { failWithError: true }
app.post('/login', passport.authenticate('ActiveDirectory', opts), function(req, res) {
res.json(req.user)
}, function (err) {
res.status(401).send('Not Authenticated')
})
// example request
// > curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost/login
```
### API

@@ -40,3 +55,3 @@

* `options` { `Object` } - Options for connecting and verification
* [`integrated=false`] { `Boolean` } - Use windows integrated login
* [`integrated=true`] { `Boolean` } - Use windows integrated login. For username and password authentication set this to `false`
* [`passReqToCallback=false`] { `Boolean` } - Pass the request to the callback

@@ -64,1 +79,7 @@ * [`usernameField="username"`] { `String` } - request body field to use for the username

* `done` { `Function` } - Passport callback
### More Information
* For information on setting up integrated authentication with IIS and Apache, review the documentation at [`passport-windowsauth`](https://github.com/auth0/passport-windowsauth#integrated-authentication-iis)
* For more information on ActiveDirectory methods review [`activedirectory`](https://github.com/gheeres/node-activedirectory)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc