serve-handler icon indicating copy to clipboard operation
serve-handler copied to clipboard

Add HTTP Auth

Open nahtnam opened this issue 7 years ago • 9 comments

It would be nice if we could have and HTTP auth flag which we can define in the now.json. There are a few static pages that I have that I would like to hide behind a basic auth.

I believe the feature existed in previous versions of server but it is gone now.

cc @leo

nahtnam avatar Sep 10 '18 18:09 nahtnam

Yes, some kind of password protection would be nice.

1cedsoda avatar Oct 09 '18 20:10 1cedsoda

Before [email protected], one could use SERVE_USER and SERVE_PASSWORD in the now.json to password-protect static deployments.

Looks like this feature has gone for all zeit static hosted websites that relied on it ? (even premium) ?

revolunet avatar Nov 04 '18 00:11 revolunet

I need to add some kind of password protection to my deployments too.

As it isn't supported "natively" by now, maybe there's the possibility to use node.js or PHP (or any other server language) to send back the good auth headers so the browser asks the user for authentication, like with HTTP Basic Authentication. Then you'd have to check the credentials by yourself in your code.

EDIT: I've put together an example of how to implement Basic Auth manually using node.js : https://github.com/flawyte/now-basic-auth

hormesiel avatar Jan 20 '19 13:01 hormesiel

Basic auth would be great while still developing applications that are not supposed to be public yet. Bonus points for adding an IP whitelist too serve as well.

janhoogeveen avatar Jul 02 '19 15:07 janhoogeveen

I submitted a PR to this and zeit/schemas to support this, hopefully it'll take 🤞

https://github.com/zeit/serve-handler/pull/96 and https://github.com/zeit/schemas/pull/54

therebelrobot avatar Jul 10 '19 03:07 therebelrobot

Really would like to have this feature too, to protect my dev environment to be discovered and used accidentally

bastiW avatar Jan 15 '20 23:01 bastiW

Bumping this.

arielaco avatar Oct 27 '21 10:10 arielaco

shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve

warren-bank avatar Feb 16 '22 02:02 warren-bank

Any progress?

chengjianhua avatar May 04 '22 16:05 chengjianhua