gno icon indicating copy to clipboard operation
gno copied to clipboard

Client-side HTTP basic authentication support

Open thehowl opened this issue 7 months ago • 3 comments

HTTP basic authentication is a simple authentication mechanism, implemented directly in the protocol. Because it is integrated at a protocol level, web services can be protected by edge web servers like nginx and caddy, without requiring changes in the application itself.

For instance, I could have a simple caddy set up of a gno.land node, password-protecting its RPC, as follows:

rpc.gno.land {
	reverse_proxy gnoland:26657
	basic_auth {
		# Username "bob", password "hiccup"
		bob $2a$14$Zkx19XLiW6VYouLHR5NmfOFU0z2GTNmpkT/5qqR7hx4IjWJPDhjvG
	}
}

However, this is not supported client-side, for instance in gnokey. The URL-spec compliant syntax for providing basic authentication is prefixing the domain with user:password@, as follows:

https://bob:[email protected]:443

It would be nice if our clients, like gnokey and gnoclient, supported basic authentication and automatically added the Authorization header in HTTP requests when provided.

thehowl avatar Jun 27 '24 12:06 thehowl