Skip to content

jbdoumenjou/auth-sandbox-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

This project is a compilation of examples of træfik configurations for the authentication.

Usage

launch the stack

Go the the directory of the example you want. Then use the docker command :

docker-compose up -d

To authenticate you, use the test:test credential or user:user for the forward authentication.
Now you just have to GET the http://whoami URL with the appropriate authentication method.

The actual examples are:

Authent Provider Example directory
Forward File + Docker forward_auth_with_docker_label/

Basic Auth

Use htpasswd to generate the user:mdp both for file and label configuration.
Use sed -e s/\\$/\\$\\$/g to escape the passwords in the labels.
Their is both users and usersFile configurations to check that all user:password are taken into account.

Digest Auth

Use htdigest to generate the user:mdp both for file and label configuration.
Their is both users and usersFile configurations to check that all user:realm:password are taken into account.

Forward Auth

The forward auth uses and httpd (v2.4) server as an external http auth server.
It is configured from this documentation
You can custom the configuration by overriding the httpd.conf file.
You can change the user:password by modifying .htpasswd and .htdigest files.

How to

create the basic auth password file

To create the password file

htpasswd -c .htpasswd user
# then type the password

To add another user:password

htpasswd .htpasswd anotherUser

Use sed -e s/\\$/\\$\\$/g to escape the passwords in the labels

create the digest auth password file

To create the password file

htdigest -c .htdigest user realm
# then type the password

To add another user:password

htdigest .htdigest anotherUser realm

test the auth server with curl (and logs)

Add the auth server in the /etc/hosts

sudo sh -c 'echo "10.0.1.10       auth.server" >> /etc/hosts'

Then, you can make the request with the server name.

curl -u user:user -k https://auth.server:443 --cert certs/client.pem --key certs/client.key -vvv

About

Simple authentication sandbox for traefik v2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published