https://github.com/flocasts/digest-auth
This repo exists to add support for digest authentication when using the Axios HTTP client. Adding support for other HTTP clients is possible as well!
https://github.com/flocasts/digest-auth
broadcastchain
Last synced: 19 days ago
JSON representation
This repo exists to add support for digest authentication when using the Axios HTTP client. Adding support for other HTTP clients is possible as well!
- Host: GitHub
- URL: https://github.com/flocasts/digest-auth
- Owner: flocasts
- Created: 2022-11-04T21:20:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-11-25T18:05:01.000Z (7 months ago)
- Last Synced: 2025-11-28T23:27:21.771Z (7 months ago)
- Topics: broadcastchain
- Language: TypeScript
- Homepage:
- Size: 91.8 KB
- Stars: 0
- Watchers: 27
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Digest Authentication
This repo exists to add support for digest authentication when using the Axios HTTP client.
Adding support for other HTTP clients is possible as well!
## Installation
```bash
npm i @flocasts/digest-auth
```
## Usage (with Axios)
```typescript
import axios from 'axios';
import { AxiosDigest } from '@flocasts/digest-auth';
const axiosDigest = new AxiosDigest('', '', axios);
const result = await axiosDigest.get('http://localhost:3000/test');
```
## Testing
Using the [concurrently](https://github.com/open-cli-tools/concurrently) package, we are able to spin up a test server to test our digest-auth solution, and close the test server on completion of tests.
To test, simply run:
```bash
npm run test
```
## Supported Digest Algorithms
If the server your request is sent to uses an algorithm not supported, you will receive the error:
`algorithm '' not supported`
- [x] MD5
- [ ] sha256
- [ ] sha512
## Supported HTTP Clients
- [x] [Axios](https://axios-http.com/docs/intro)
- [ ] [NestJs HTTPModule](https://docs.nestjs.com/techniques/http-module)
- [ ] [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)
- [ ] [Ajax](https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX/Getting_Started)