{"id":25856970,"url":"https://github.com/m42e/authserver","last_synced_at":"2025-10-10T11:34:08.806Z","repository":{"id":38317791,"uuid":"205724584","full_name":"m42e/authserver","owner":"m42e","description":"A simple nginx auth_request compatible authentication server","archived":false,"fork":false,"pushed_at":"2023-05-01T21:15:22.000Z","size":21,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T19:16:24.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m42e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-01T19:46:05.000Z","updated_at":"2023-03-04T18:04:11.000Z","dependencies_parsed_at":"2022-08-17T16:10:24.319Z","dependency_job_id":null,"html_url":"https://github.com/m42e/authserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fauthserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fauthserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fauthserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fauthserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m42e","download_url":"https://codeload.github.com/m42e/authserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241407322,"owners_count":19958107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-01T18:29:30.875Z","updated_at":"2025-10-10T11:34:03.763Z","avatar_url":"https://github.com/m42e.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authserver\n\nThis repository offers a (to be honest a hacky) implementation which allows to use a login using `auth_request` module in nginx.\nIt enforces two factor authorization or token based `Authorization` header.\n\n## Add User\nRun the docker image with `adduser` and `-it`.\n\n## Create a token\nRun the docker image with `token \u003cusername\u003e`.\n\n## Delete a token\nRun the docker image with `token \u003cusername\u003e --rm \u003ctoken\u003e`.\n\n\n## Run Docker\n\n```sh\ndocker run -v /var/proj/authserver/data:/home/appuser -p 127.0.0.1:9999:9999/tcp authserver:latest\n```\n\n\n## Nginx Configuration\n\n### authorization protected\n\n```nginx\nlocation ^~ / {\n    proxy_pass http://127.0.0.1:5232;\n    auth_request /login-validate;\n    auth_request_set $auth_user $upstream_http_x_user;\n    proxy_set_header     X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header Remote-User $auth_user;\n    proxy_set_header X-Remote-User $auth_user;\n\t\t# Set the header according what you need.\n\t\t\n}\n\nerror_page 401 /error/401.html;\n\n# If the user is not logged in, redirect them to login URL\nlocation = /error/401.html {\n  return 302 https://login.d1v3.de/login?fwd=https://$http_host$request_uri;\n}\n\n\nlocation = /login-validate {\n  proxy_pass http://127.0.0.1:9999/auth;\n  proxy_pass_request_body off; # no need to send the POST body\n\n  proxy_set_header Content-Length \"\";\n  proxy_set_header X-Real-IP $remote_addr;\n  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n  proxy_set_header X-Forwarded-Proto $scheme;\n  auth_request_set $auth_user $upstream_http_x_user;\n}\n```\n\n### login page\n\n```nginx\nlocation / {\n\tproxy_pass http://127.0.0.1:9999/;\n\tproxy_set_header  Host  login.d1v3.de;\n\tproxy_set_header  X-Forwarded-Proto https;\n\tif ($scheme != \"https\") {\n\t\trewrite ^ https://$host$request_uri? permanent;\n\t}\n}\n```\n\n# TODOs\n\n- Web interface for account and token managing\n- Rest interface for accounts and tokens.\n- Logging of Logins\n- Token activity\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm42e%2Fauthserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm42e%2Fauthserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm42e%2Fauthserver/lists"}