# amps-kerberos-authenticator

> AMPS Kerberos Authenticator

Latest version **1.0.3** (published 2019-07-09) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install amps-kerberos-authenticator
pnpm add amps-kerberos-authenticator
yarn add amps-kerberos-authenticator
bun add amps-kerberos-authenticator
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-07-09 |
| First published | 2019-07-02 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 22.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 60East Technologies, Incorporated |
| Maintainers | 60east |
| Keywords | AMPS, Kerberos, Authenticator, Client |

## Links

- npm: https://www.npmjs.com/package/amps-kerberos-authenticator
- Repository: https://github.com/60East/amps-authentication-javascript
- Homepage: https://github.com/60East/amps-authentication-javascript#readme
- Issues: https://github.com/60East/amps-authentication-javascript/issues
- npm.io page: https://npm.io/package/amps-kerberos-authenticator

## Dependencies (2)

- [amps](https://npm.io/package/amps.md) 5.3.0-0.333340.b0dae99
- [kerberos](https://npm.io/package/kerberos.md) 1.1.2

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-07-09
- 1.0.2 — 2019-07-09
- 1.0.1 — 2019-07-04
- 1.0.0 — 2019-07-02

## README

# AMPS JavaScript Client Kerberos Authentication for Node.js


## Installation

```bash
npm install --save amps-kerberos-authenticator
```

## Dependencies

`amps-kerberos-authenticator` depends on the `amps` and `kerberos` packages. In case of the installation from NPM,
all the dependencies are installed automatically.


## Kerberos Prerequisites

- AMPS SPN (for example, `AMPS/host.domain.com`)
- Optionally set Kerberos environment variables
  - `KRB5_CONFIG` set to a **krb5.conf** file that will override the default (the default is `/etc/krb5.conf` on linux)
  - `KRB5_CLIENT_KTNAME` set to a KeyTab for the user you want to authentication as

  In Node.js, environment variables can be set in the source code:
  ```javascript
  process.env['KRB5_CONFIG'] = '/path/to/krb5.conf';
  process.env['KRB5_CLIENT_KTNAME'] = '/path/to/client_name.keytab';
  ```


## Example

For Kerberos authentication using JavaScript there is a single class, `AMPSKerberosAuthenticator`,
for authentication in Node.js environment.

```javascript

const Client = require('amps').Client;
const AMPSKerberosAuthenticator = require('amps-kerberos-authenticator').AMPSKerberosAuthenticator;


async function main() {
    const client = new Client('demo');

    // connection credentials
    const login = 'username';
    const port = 10304;
    const hostName = 'hostname';
    const uri = `ws://${login}@${hostName}:${port}/amps/json`;
    const spn = `AMPS/${hostName}`;

    try {
        // connect
        await client.connect(uri, new AMPSKerberosAuthenticator(spn));
    }
    catch (err) {
        console.error('err: ', err);
    }
}


main();
```


## See Also

[Kerberos Authentication Blog Article](http://www.crankuptheamps.com//blog/posts/2019/06/04/kerberos-authentication/)

[libamps_multi_authentication](http://devnull.crankuptheamps.com/documentation/html/5.3.0.0/user-guide/html/chapters/auxiliary_modules.html#authentication-with-the-amps-multimechanism-authentication-module) AMPS Server Module

---
_Source: https://npm.io/package/amps-kerberos-authenticator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
