Summary | Discourse Telegram Login is a simple plugin that enables authentication via Telegram Login Widget | |
Repository Link | GitHub - fokx/discourse-telegram-login | |
Install Guide | How to install plugins in Discourse |
Features
Enable user to login via Telegram.
Configuration
- Setup a bot in Telegram following From BotFather to 'Hello World' .
- Enable this plugin and fill in
telegram_login_bot_name
andtelegram_login_bot_token
. - You may need to add
https://telegram.org/js/telegram-widget.js
and'unsafe-inline'
tocontent security policy script src
.
Note
-
When successfully authenticated using Telegram, this plugin creates a user with a dummy email:
<telegram-id>@telegram.invalid
. This may lead to the user losing email notification functionality. pr-welcome to use telegram message as an alternative to email. -
After clicking ‘Login with Telegram’, a new window will open, containing the Telegram Login Widget.
Then this plugin will try to open the actual Telegram authentication window, which can be blocked by browser.
Anyway, the user can click the button in the widget to do it manually. pr-welcome to reduce the second click.
TODO
- Use bot message as an alternative to email
- Avoid an extra button click by redirecting and capture the returning
tgAuthResult
Acknowledgements
This plugin won’t be here without the work by GitHub - mjsir911/discourse-telegram-auth and GitHub - yurijmi/omniauth-telegram: An OmniAuth strategy for Telegram , both of which have long been unmaintained. Thanks @mjsir911!