{"id":22892382,"url":"https://github.com/b4fun/tg-auth","last_synced_at":"2025-03-31T22:10:23.900Z","repository":{"id":98920574,"uuid":"578455270","full_name":"b4fun/tg-auth","owner":"b4fun","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-23T22:34:04.000Z","size":69,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T14:03:20.301Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/b4fun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"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},"funding":{"github":"bcho","patreon":"artofhbc","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-12-15T05:05:07.000Z","updated_at":"2022-12-23T22:27:21.000Z","dependencies_parsed_at":"2023-05-31T01:16:31.945Z","dependency_job_id":null,"html_url":"https://github.com/b4fun/tg-auth","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/b4fun%2Ftg-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4fun%2Ftg-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4fun%2Ftg-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4fun%2Ftg-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b4fun","download_url":"https://codeload.github.com/b4fun/tg-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246547366,"owners_count":20794970,"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":"2024-12-13T22:59:46.894Z","updated_at":"2025-03-31T22:10:23.882Z","avatar_url":"https://github.com/b4fun.png","language":"Go","funding_links":["https://github.com/sponsors/bcho","https://patreon.com/artofhbc"],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003e\n\u003ca href=\"https://github.com/b4fun/tg-auth\"\u003e\n\u003cimg src=\"docs/assets/logo.svg\" width=\"180\npx\" heigh=\"auto\" style=\"inline-block\" /\u003e\n\u003c/a\u003e\n\u003c/h3\u003e\n\n\u003ch4 align=\"center\"\u003e\nAuthentication/authorization middleware with Telegram.\n\u003c/h4\u003e\n\n**tg-auth** enables drop-in [Telegram based authn/z][telegram-login] to your service. No modifications needed for your application's code.\n\n[telegram-login]: https://core.telegram.org/widgets/login\n\n![](./docs/assets/diagram.png)\n\n## Settings\n\ntg-auth runs with following environment variables:\n\n| Variable Name | Description | Sample |\n|-----------:|:---|:---|\n| `BOT_NAME` | Telegram bot name | |\n| `BOT_TOKEN` | Telegram bot token | |\n| `SIGNIN_URL` | URL endpoint of the signin protoal | `https://example.com/signin` |\n| `SIGNIN_REDIRECT_CALLBACK_URL` | URL endpoint of the Telegram signin callback | `https://example.com/signin/callback` |\n| `SIGNIN_AFTER_SIGNIN_URL` | URL endpoint after succeeded authentication | `https://example.com` |\n| `AUTHZ_CHANNEL_IDS` | `,` separated Telegram channel id for checking user access permission | `-12345,-67890` |\n| `AUTHZ_CACHE` | User access check cache TTL. Defaults to 5 minutes | `5m` |\n| `AUTHN_COOKIE_SIGNING_KEY` | Base64 encoded AES signing key for encrypting cookie value. | |\n| `AUTHN_COOKIE_NAME` | Name of the cookie | | \n| `AUTHN_COOKIE_DOMAIN` | The domain of the cookie | `example.com` |\n| `AUTHN_SESSION_TTL` | TTL of the cookie. Defaults to 1 hour | `1h` |\n\n## Examples\n\n- Using with envoy: [examples/envoy](./examples/envoy/)\n\n## LICENSE\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb4fun%2Ftg-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb4fun%2Ftg-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb4fun%2Ftg-auth/lists"}