Pular para o conteúdo

Telegram

With Telegram, sign-in requests arrive as messages from your company’s own bot, with Approve and Deny buttons. Nothing to install for users who already have Telegram. You create the bot; OkYouIn talks to it through the Telegram Bot API.

  1. In Telegram, open a chat with @BotFather, send /newbot and follow the questions — a display name (for example Example Corp sign-in) and a username ending in bot.

  2. BotFather answers with a token like 123456789:AA…. Treat it like a password: whoever holds it controls the bot.

  3. In OkYouIn open Settings ▸ System ▸ MFA Settings, click Telegram (Configure Telegram) and paste the token into Bot token. Check token asks Telegram which bot it belongs to and shows Bot name: … — it works before saving.

  4. Choose the Delivery method (below) and save.

  5. Switch on Telegram in Provider Configuration. It cannot be enabled without a token.

The token is stored encrypted and never shown again; it is kept out of logs and error messages.

Telegram tells the bot about button presses either way:

MethodHow it worksWhen to use
Polling (default)OkYouIn asks Telegram for updates over outbound HTTPS only.Almost always — nothing to open in your firewall, works behind NAT and through an outbound proxy.
WebhookTelegram calls OkYouIn. Needs a Webhook URL — the public https:// address of your server, which Telegram must be able to reach — and a Webhook secret (16–256 characters; Generate makes one). Telegram sends the secret with every update; others are rejected.When you prefer inbound delivery and OkYouIn is reachable from the internet.

A bot can have only one consumer. Do not use the same bot token for another system, or for two OkYouIn installations — they would take each other’s updates. In a cluster, OkYouIn makes sure only one node receives the bot’s updates at a time.

SettingDefaultNotes
Show the client IP in push messagesonThe sign-in’s address in the Telegram message.
Show the User-Agent in push messagesonThe sign-in’s browser in the Telegram message.
Enrollment link lifetime (seconds)60060 to 3600. How long a user has to open the bot from the enrollment link.

The user chooses Telegram in My account or from a setup link. OkYouIn shows a one-time link (and QR code) to the bot. The user opens it and presses Start; the bot links that chat to the user and sends a test request. Approving it activates the method.

A request is accepted only from that chat and that Telegram account.

The bot sends a sign-in request with the application and — if enabled — the address and browser, and Approve / Deny buttons. The sign-in waits for the answer, up to the Push Challenge Timeout (default 120 seconds). When a request expires, the message is updated to say so.

Things to know:

  • Telegram answers reach OkYouIn through Telegram’s servers, so there is no approving-device address: the approving-device country check does not apply to Telegram, and the Access log shows the approval device as not available.
  • Telegram is a push: it works with devices that cannot show a prompt, there is no number matching, and it counts towards push flood protection.
  • OkYouIn needs outbound access to the Telegram API. If it fails, Telegram users cannot sign in; a provider health alert tells you when delivery is not running.