Skip to content

tillg/nginx_with_logins_vouch

Repository files navigation

nginx_with_logins

A demo setup for having restricted access to web-sites or specific paths within a website based on nginx. docker-composed based and deployed via Ansible.

The behavior we want to achieve:

Overall setup

Setup

The login flow is as folllows:

Login flow

That's what happens during the login:

  1. User sends request w/o being logged in to https://grtnr.io/secret
  2. nginx checks the credentials by forwarding it to vouch: By routing it to /validate that corresponds to http://vouch:9090/validate (within the docker-compose network)
  3. Vouch inspects the headers and returns 401 Unauthorized
  4. For nginx this is an error and it forwards the brwoser to the error page: https://vouch.grtnr.io/login?url=$scheme://$http_host$request_uri&vouch-failcount=$auth_resp_failcount&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err
  5. The browser sends a request to this URL of vouch
  6. Vouch responds with a 302 Found and redirects the browser to Google Login.
  7. Browser goes to Google and logs in.
  8. Google login redirects the browser to the reurn address: https://vouch.ngingtest.grtnr.io/auth
  9. Browser sends request to the vouch URL
  10. Vouch redirects browser to nginx: https://grtnr.io/secret
  11. Browser send request to https://grtnr.io/secret, this time with a JWT

Google settings

webapp

webapp credentials

Reading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages