Announce: New Login Plugin

Hi there,

yesterday I released version 1.0.0 of my caddy login plugin and uploaded it to the caddy website:

https://caddyserver.com/docs/http.login

It already supports some backends like htpasswd file, and Github Oauth login and is open to be extended.

Please give it a try. Your issues/suggestions/PRs are appreciated!

Regards,
Sebastian

3 Likes

Maybe now I can finally remove .htpasswd support from the basicauth middleware!

2 Likes

Looks pretty cool, can’t wait to check it out.

I am really excited to use the github auth.
I could not get it to work tho:

Running on a raspberrypi 3

$ caddy -version
Caddy 0.10.3
$ caddy -plugins        
Server types:
  http
  net

Caddyfile loaders:
  short
  flag
  default

Event hook plugins:
  hook.service

Other plugins:
  http.basicauth
  http.bind
  http.browse
  http.cors
  http.errors
  http.expvar
  http.ext
  http.fastcgi
  http.filemanager
  http.git
  http.gzip
  http.header
  http.index
  http.internal
  http.limits
  http.log
  http.login
  http.markdown
  http.mime
  http.pprof
  http.proxy
  http.push
  http.redir
  http.rewrite
  http.root
  http.status
  http.templates
  http.timeouts
  http.upload
  http.websocket
  net.host
  shutdown
  startup
  tls
  tls.storage.file

$ cat Caddyfile 
login / {
  github client_id=xxxxxxxxxx,client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
}

$ caddy -conf Caddyfile
Caddyfile:2 - Parse error: Unknown directive 'github'

What am I missing?

The first line of your Caddyfile must always be the address of the site to serve. :wink:

:facepalm:
Thanks matt.

Maybe the error could be improved on this one in the future