# jscas-ad-attributes-resolver

> An attributes resolver for JSCAS that get attributes from Active Directory

Latest version **1.0.0** (published 2018-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install jscas-ad-attributes-resolver
pnpm add jscas-ad-attributes-resolver
yarn add jscas-ad-attributes-resolver
bun add jscas-ad-attributes-resolver
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-03-29 |
| First published | 2018-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Sumners |
| Maintainers | jsumners |
| Keywords | jscas, cas |

## Links

- npm: https://www.npmjs.com/package/jscas-ad-attributes-resolver
- Repository: https://github.com/jscas/jscas-ad-attributes-resolver
- Homepage: https://github.com/jscas/jscas-ad-attributes-resolver#readme
- Issues: https://github.com/jscas/jscas-ad-attributes-resolver/issues
- npm.io page: https://npm.io/package/jscas-ad-attributes-resolver

## Dependencies (3)

- [adldap](https://npm.io/package/adldap.md) ^3.1.4
- [conflate](https://npm.io/package/conflate.md) ^1.4.0
- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^0.2.2

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-03-29
- 1.0.0-rc.1 (next) — 2018-03-28

## README

# jscas-ad-attributes-resolver

This module provides a user attributes resolver plugin for the
[JSCAS server][jscas]. This plugin is intended to retrieve attributes from
an Active Directory instance, but may also work agains generic LDAP servers.

[jscas]: https://github.com/jscas/jscas-server

## Configuration

The module requires a configuration object matching:

```javascript
{
  ad: { // required
    searchUser: 'cn=jsmith,ou=users,dc=example,dc=com', // required
    searchPass: 'jsmith_password', // required
    ldapjs: {
      url: '(ldap|ldaps)://active.directory.server', // required
      searchBase: 'dc=example,dc=com', // required
      scope: 'base', // 'base', 'one', 'sub' default: 'sub'
      attributes: [ 'dn', 'cn', 'sn', 'givenName', 'mail', 'memberOf' ] // optional
      }
    }
  },
  attributesMap: {} // optional
}
```

### ad

The `ad` property defines the configuration that will be passed to the
underlying [adldap module][admod]. This configuration is supplied
to the `adldap` module as-is.

[admod]: https://www.npmjs.com/package/adldap

#### ad.searchUser

The username the AD module will use to bind to the server for search operations.

#### ad.searchUserPass

The password for `ad.searchUser`.

#### ad.ldapjs.url

An LDAP URL pointing to your Active Directory server. This property is
required.

#### ad.ldapjs.searchBase

The DN under which all search queries will be performed. This includes
authentications.

#### ad.ldapjs.scope

The search method to use. This module's default is `'sub'`.

#### ad.ldapjs.attributes

An array of attributes to include in search results. These will
be used by *cas-server* as extra attributes during CAS 3.0 authentication. The
default attribute set is:

```javascript
[ 'dn', 'cn', 'sn', 'givenName', 'mail', 'memberOf' ]
```

#### attributesMap

Allows you to rename the attributes returned in user searches. It should be
an object where keys are the AD names and values are the new names. For example:

```javascript
{
  sAMAccountName: 'firstName'
}
```

will rename the `sAMAccountName` property to `firstName` and leave all other
property names alone.

## License

[MIT License](http://jsumners.mit-license.org/)

---
_Source: https://npm.io/package/jscas-ad-attributes-resolver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
