Comments (5)
@adiroiban And what if I don't want to use an .htpasswd
file?
from http-auth.
btw extension for digest authentication is not .htpasswd, but .htdigest :)
from http-auth.
Here is my take on this
const auth = require('http-auth');
const auth_method = auth.digest({
realm: 'assistant-relay',
file: __dirname + '/path/to/your/users.htpasswd'
});
const app = express();
// http-auth should be the first middleware to use.
app.use(auth.connect(auth_method));
Then in users.htpasswd
store the HA1 hash.
The documentation is wrong about passHash
as this is not the password hash but
HA1 = MD5(username:realm:password)
To create the hash do: $ echo -n USER-NAME:REAL-NAME:PASSWORD-CLEAR | md5sum
I will try to submit a PR for this :)
from http-auth.
The current API only has the local file path option.
there is no option to pass a stream or delegate to other function.
@gevorg thanks :) good point :)
from http-auth.
The current API only has the local file path option.
there is no option to pass a stream or delegate to other function.@gevorg thanks :) good point :)
Did you check https://github.com/http-auth/http-auth/blob/master/examples/digest_nofile.js ?
from http-auth.
Related Issues (20)
- Add support Safari HOT 1
- how to use next or done in basic.check()? HOT 3
- Add ability to pass users array if file is not specified. HOT 1
- Loading linux musl addon Error: Cannot find module '@node-rs/bcrypt-linux-musl' HOT 1
- How to use htdigest method
- Usage of @node-rs/bcrypt results in crash when webpack is used HOT 3
- update uuid version to v7 later
- The `self = this` lines are not needed.
- The parser for the βBasicβ scheme is not RFC-compliant.
- How to handle `upgrade-insecure-requests` ? HOT 2
- Exclude a given network or IP from authentication HOT 1
- hapi 17 support HOT 1
- (express) Doesn't work with static content HOT 1
- typescript declaration file HOT 5
- Digest not working HOT 1
- Koa@Next example not working HOT 6
- Replay is possible in digest notification HOT 2
- auth-scheme is supposed to be case-insensitive per RFC HOT 1
- Expressjs auth.connect does not work anymore HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-auth.