Skip to content

b4fun/tg-auth

Repository files navigation

Authentication/authorization middleware with Telegram.

tg-auth enables drop-in Telegram based authn/z to your service. No modifications needed for your application's code.

Settings

tg-auth runs with following environment variables:

Variable Name Description Sample
BOT_NAME Telegram bot name
BOT_TOKEN Telegram bot token
SIGNIN_URL URL endpoint of the signin protoal https://example.com/signin
SIGNIN_REDIRECT_CALLBACK_URL URL endpoint of the Telegram signin callback https://example.com/signin/callback
SIGNIN_AFTER_SIGNIN_URL URL endpoint after succeeded authentication https://example.com
AUTHZ_CHANNEL_IDS , separated Telegram channel id for checking user access permission -12345,-67890
AUTHZ_CACHE User access check cache TTL. Defaults to 5 minutes 5m
AUTHN_COOKIE_SIGNING_KEY Base64 encoded AES signing key for encrypting cookie value.
AUTHN_COOKIE_NAME Name of the cookie
AUTHN_COOKIE_DOMAIN The domain of the cookie example.com
AUTHN_SESSION_TTL TTL of the cookie. Defaults to 1 hour 1h

Examples

LICENSE

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages