{"id":21359230,"url":"https://github.com/thomaschampagne/traefik-sso","last_synced_at":"2025-10-04T23:57:28.979Z","repository":{"id":37105346,"uuid":"280963028","full_name":"thomaschampagne/traefik-sso","owner":"thomaschampagne","description":"Docker image implementing a straightforward Single Sign-On authentication for your containers behind a Traefik v2 edge router","archived":false,"fork":false,"pushed_at":"2023-06-05T05:08:57.000Z","size":1501,"stargazers_count":5,"open_issues_count":62,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-04T23:57:24.703Z","etag":null,"topics":["authentication","docker","sso","traefik"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/thomaschampagne/traefik-sso","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomaschampagne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-19T22:40:47.000Z","updated_at":"2021-12-25T00:27:52.000Z","dependencies_parsed_at":"2024-11-22T07:03:09.992Z","dependency_job_id":null,"html_url":"https://github.com/thomaschampagne/traefik-sso","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thomaschampagne/traefik-sso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Ftraefik-sso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Ftraefik-sso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Ftraefik-sso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Ftraefik-sso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomaschampagne","download_url":"https://codeload.github.com/thomaschampagne/traefik-sso/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Ftraefik-sso/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278391183,"owners_count":25978945,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["authentication","docker","sso","traefik"],"created_at":"2024-11-22T05:27:06.957Z","updated_at":"2025-10-04T23:57:28.962Z","avatar_url":"https://github.com/thomaschampagne.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/thomaschampagne/traefik-sso/master/traefik-sso.svg\" style=\"border: 0px\" alt=\"\"/\u003e\u003c/div\u003e \u003c!--https://vectr.com/thomaschampagne/h5j5xaixL1--\u003e\n\n![Version](https://img.shields.io/github/package-json/v/thomaschampagne/traefik-sso?style=flat-square)\n![License: MIT](https://img.shields.io/github/license/thomaschampagne/traefik-sso?style=flat-square)\n\n![Docker Pulls](https://img.shields.io/docker/pulls/thomaschampagne/traefik-sso.svg?style=flat-square)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/thomaschampagne/traefik-sso/main/dev?label=traefik-sso:dev\u0026style=flat-square)\n\n\n![angular](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/@angular/core?filename=frontend%2Fpackage.json\u0026label=angular\u0026style=flat-square) \n![ng-boostrap](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/@ng-bootstrap/ng-bootstrap?filename=frontend%2Fpackage.json\u0026label=ng-boostrap\u0026style=flat-square)\n![express](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/express?filename=backend%2Fpackage.json\u0026label=express\u0026style=flat-square)\n![bcryptjs](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/bcryptjs?filename=backend%2Fpackage.json\u0026label=bcryptjs\u0026style=flat-square)\n![jsonwebtoken](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/jsonwebtoken?filename=backend%2Fpackage.json\u0026label=jsonwebtoken\u0026style=flat-square)\n![typescript](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/dev/typescript?filename=backend%2Fpackage.json\u0026label=typescript\u0026style=flat-square)\n![rollup](https://img.shields.io/github/package-json/dependency-version/thomaschampagne/traefik-sso/dev/rollup?filename=backend%2Fpackage.json\u0026label=rollup\u0026style=flat-square)\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n------------\n\n# Traefik SSO\n\n## What'is Traefik-sso?\n\nIt's a docker image which implements a straightforward **Single Sign-On** authentication for containers behind a [Traefik v2](https://hub.docker.com/_/traefik) edge router.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cdiv\u003e\u003cimg src=\"https://imgur.com/m2lq5mD.gif\" style=\"border: 0px\" alt=\"\"/\u003e\u003c/div\u003e\n    \u003cdiv\u003e\u003ci\u003eAuthentication sequence to a Portainer container through Traefik v2 + Traefik-sso\u003c/i\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\n## Local demo\n\n1 - Run the below docker-compose command locally \n\n```bash\ndocker-compose -f ./docker-compose.yml -f ./docker-compose.local.yml up -d\n```\nSee [docker-compose.yml](./docker-compose.yml), [docker-compose.local.yml](./docker-compose.local.yml) \u0026 [.env](./.env) files\n\n2 - When containers are up, open `${PWD}/data/db.json` and add the below temporary `alice` user:\n\n```json\n{\n    \"users\": [\n        {\n            \"username\": \"alice\",\n            \"password\": \"$2y$10$mNJw6ojRWORz10gDaj602.8auytb58peR/hwdewqFpCershSO7DGm\"\n        }\n    ]\n}\n```\n\nThe password has been hashed using `bcrypt`, value is `4lic3`.\n\n3 - Open http://iamfoo.domain.localhost in a browser (or http://iambar.domain.localhost).\n\n4 - You should be redirected to http://sso.domain.localhost to logon on the domain `domain.localhost`\n\n5 - Logon using username: `alice` and password: `4lic3`.\n\n6 - You should be redirected to http://iamfoo.domain.localhost (or http://iambar.domain.localhost)\n\n7 - Logout from sso using http://sso.domain.localhost/logout. This will clear jwt token cookie on domain `*.domain.localhost`  \n\n*Note: Environment variables used in demo are defined in `.env` file.*\n\n## Environment variables\n\n| Name          | Description                                                                                       |\n|---------------|---------------------------------------------------------------------------------------------------|\n| DOMAIN        | Domain to authenticate through the sso                                                            |\n| SECRET        | Secret used for JWT token signature.                                                              |\n| TOKEN_MAX_AGE | Set JWT token life time. Must match with regex: https://regex101.com/r/Q9rYJW/2                         |\n| LOG_LEVEL     | Log level (DEBUG, INFO, WARN or ERROR). Do not use DEBUG in production.                           |\n\n## Manage users\n\nUsers can be currently managed by editing json database file `${PWD}/data/db.json` through the key `users`. A user-friendly UI is planned to perform this. The current workflow is temporary.\n\n### Add or edit users\n \nTo add new or update existing credentials you might use the following curl command on `/hash` endpoint. This api will hash the account password using bcrypt:\n\n```bash\ncurl -d '{\"username\":\"eve\", \"password\":\"3v3\"}' -H \"Content-Type: application/json\" -X POST https://sso.domain.localhost/hash; echo\n```\n\nResult:\n\n```bash\n{\"username\":\"eve\",\"password\":\"$2a$10$f1sHYu64iZ0zUX6vXnqj0uLE691O0bQTV.YuHw1At2PGL8CBWk/P6\"}\n```\n\nYou need to manually add this json output in the **db.json** database file (`users` key).\n\n### Remove users\nJust remove selected users entries in json array.\n\n## Configure SSO login page labels and styles\n\nYou can change every text and css styles of you sso login page by editing file `${PWD}/data/config.json`. \n\nThis `config.json` file is following the [AppConfig](https://github.com/thomaschampagne/traefik-sso/blob/master/shared/models/app-config.ts) typescript structure\n\nHere's the UML diagram of this structure:\n\n![UML](http://www.plantuml.com/plantuml/svg/bLDDSzCm4BthLsXwRu035s2W9C09c4wTOoyRQMDh8ckDj6eQElxls4vSEKQPJdFIl8_ilcVf9Z1uZhKLOMTS0nvgMPCZLNcgKRAFE65kEwrHfW77jw2rSQLy_tR2B-bnnDzDyGB_H7GAEtu9QbTwYawlo9AN-yem2c4Sez-2GlcrQLRajgQKJq9sFmiRjE7BXvxuEPm_3dZWWyKJNWndqOfafklhv90p8bdIuAG-3TwZLLJZsh35RanWt-KwpeR85Jes2XZr6XzvnbigZLj6Pd8Pjh6Wi2AhqVVxFyaOq3keyLac6mXXJrwFY6oFLlIUHfFhjo1l_g9EnWtekxxim0aBw1_GV--jq_zhP-67HiRm6zA7OxTt61fomJpW83YrloLVN-RdvULriwRoibHu4PN245wI_G1Zexyuj1KfQdSLSg9fBtCwDQHn2z5oeJoY6vXkvF10m7vQ5SK0VKDbmGCRSfzFrxO6Qrzhik1BV8sf5S8HexpwHHjZyOt6i6DgJe_cIaB89VjDZ2ANUB6u99zsbLbbl4tdZ_xyEQZ_eGfDMV4vjZUQgtDeiLY8ThPm-hAPTSPMreUchzCqVEyoidlt76geAYCPicVmRgUByXjqEjRs7m00)\n\nNote: To configure properly your styles css properties (default, small \u0026 large screens) in `config.json` file, you can refer to the typescript interface [CSSStyleDeclaration](https://github.com/microsoft/TypeScript/blob/v3.9.7/lib/lib.dom.d.ts#L2757).\n\n## Build production image\n\n```bash\ndocker build -t traefik-sso:yourtag .\n```\n\n## Local development\n\n1 - Install npm dependencies\n \n```bash\nnpm install\n```\n\n2 - Build local `traefik-sso:dev` image through compose\n\n```bash\nnpm run docker:dev:build\n# or\ndocker-compose -f ./docker-compose.yml -f ./docker-compose.dev.yml build\n```\n\n3 - Run local development\n\n```bash\nnpm run docker:dev:up\n# or\ndocker-compose -f ./docker-compose.yml -f ./docker-compose.dev.yml up\n```\n\n4 - Now follow steps from [local demo](#local-demo) section, you have same environment but in development 😊.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaschampagne%2Ftraefik-sso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomaschampagne%2Ftraefik-sso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaschampagne%2Ftraefik-sso/lists"}