# authorization-hmac256

> Amazon style authorization using signing.

Latest version **1.0.1** (published 2018-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install authorization-hmac256
pnpm add authorization-hmac256
yarn add authorization-hmac256
bun add authorization-hmac256
```

## 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.1 |
| Published | 2018-02-16 |
| First published | 2017-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jingram@classy.org |
| Maintainers | jingram |
| Keywords | authorization, amazon, hmac, sha256 |

## Links

- npm: https://www.npmjs.com/package/authorization-hmac256
- Repository: https://github.com/jnngrm/authorization-hmac256
- Homepage: https://github.com/jnngrm/authorization-hmac256#readme
- Issues: https://github.com/jnngrm/authorization-hmac256/issues
- npm.io page: https://npm.io/package/authorization-hmac256

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-02-16
- 1.0.0 — 2017-08-04

## README

# authorization-hmac256
Amazon style authorization using HMAC-SHA256 signing.

# installation

 $ npm install --save authorization-hmac256

# options

* service: (STRING) the name of the service, typically acronym like AWS or CWS (Classy Web Services)
* token: (STRING) unique identifier for client making call, like OAuth2 client ID
* secret: (STRING) secret value used for signing

# usage

HmacAuthorize.sign(method, path, contentType, body)

```javascript
const request = require('request');
const HmacAuthorize = require('authorization-hmac256')({
  service: 'service',
  token: 'token',
  secret: 'secret'
});

function postSomething(next) {
  let method = 'POST';
  let resource = '/sample/resource';
  let contentType = 'application/json';
  let body = {
    key: 'value'
  };
  let authorization = HmacAuthorize.sign(method, resource, contentType, JSON.stringify(body));
  request({
    url: 'http://api.acme.org',
    method,
    headers: {
      'Content-Type': contentType,
      'Authorization': authorization
    },
    body: JSON.stringify(body)
  }, next);
}
```

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