Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

The Telegram authentication backend exists in social-core but lacked documentation in social-docs.

Changes

  • Created docs/backends/telegram.rst with configuration instructions:

    • Bot token setup via BotFather
    • Backend registration in AUTHENTICATION_BACKENDS
    • Login widget integration with HTML example
    • Security details (HMAC-SHA256 verification, 24-hour validity)
    • User data extraction (ID, username, first/last name, photo URL)
  • Updated docs/backends/index.rst to include telegram in alphabetical order

Usage Example

# settings.py
AUTHENTICATION_BACKENDS = (
    'social_core.backends.telegram.TelegramAuth',
)

SOCIAL_AUTH_TELEGRAM_BOT_TOKEN = 'your_bot_token'
<!-- login.html -->
<script async src="https://telegram.org/js/telegram-widget.js?22"
        data-telegram-login="YOUR_BOT_USERNAME"
        data-auth-url="http://example.com/complete/telegram/"
        data-request-access="write"></script>

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.python.org
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/sphinx-build -b html -d _build/doctrees . _build/html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Telegram documentation missing</issue_title>
<issue_description>I would like to see Telegram login support in Python Social Auth - Django

Support seems present in social-core

https://github.com/python-social-auth/social-core/blob/master/social_core/backends/telegram.py

Could you please implement Telegram login support with proper documentation.

Thank you</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add Telegram login support to Python Social Auth Add Telegram backend documentation Nov 10, 2025
Copilot AI requested a review from nijel November 10, 2025 11:55
@nijel nijel requested a review from Copilot November 10, 2025 12:31
@nijel nijel marked this pull request as ready for review November 10, 2025 12:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation for the Telegram authentication backend to the social-python-social-auth library. The documentation describes how to set up Telegram's widget-based authentication using a bot token.

  • New documentation file created for Telegram backend setup
  • Index updated to include Telegram in the alphabetical list of supported backends

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/backends/telegram.rst Comprehensive setup guide for Telegram authentication backend including bot creation, configuration settings, widget integration, and security details
docs/backends/index.rst Added telegram entry to the alphabetical list of social backends

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


- The Telegram Login Widget can be added using the following HTML::

<script async src="https://telegram.org/js/telegram-widget.js?22"
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ?22 query parameter in the Telegram widget script URL is unclear. If this is a version number required by Telegram's API, it should be documented or explained. If it's not necessary, it should be removed. Please verify this is the correct and current script URL from Telegram's official documentation.

Suggested change
<script async src="https://telegram.org/js/telegram-widget.js?22"
<script async src="https://telegram.org/js/telegram-widget.js"

Copilot uses AI. Check for mistakes.
data-telegram-login="YOUR_BOT_USERNAME"
data-size="large"
data-auth-url="http://example.com/complete/telegram/"
data-request-access="write"></script>
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data-request-access="write" attribute should be explained. It's unclear what "write" access means in the context of Telegram authentication and whether this is required, optional, or what other values are acceptable. Consider adding a brief explanation or link to Telegram's documentation about this parameter.

Copilot uses AI. Check for mistakes.
@nijel nijel enabled auto-merge (squash) November 10, 2025 12:35
@nijel nijel merged commit 4adec92 into master Nov 10, 2025
5 checks passed
@nijel nijel deleted the copilot/add-telegram-login-support branch November 10, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Telegram documentation missing

2 participants