Lana Login with Telegram Passport

"Lana Login with Telegram Passport" v1.1.0 Documentation by "Lana Codes"


Introductory

The "Lana Login with Telegram Passport" plugin allows to authorize users in WordPress with Telegram Passport.


The "Lana Login with Telegram Passport" plugin is WordPress 6.2 compatible.

It has been tested on the following browsers:

  • Google Chrome
  • Firefox
  • Opera
  • Edge
  • Safari

You have to enable JavaScript in your browser to use this plugin.


Important: The "Lana Login with Telegram Passport" plugin does not support ID Documents and Proof of Address data.


Support

If you have any more questions, feel free to contact us at: https://codecanyon.net/user/lanacodes

Created: 01/01/2023
By: Lana Codes
E-mail: [email protected]



Installation

1. Install WordPress

Download and Install WordPress 4.5 (or higher).


2. Upload Plugin via FTP

Upload "Lana Login with Telegram Passport" plugin folder via FTP into /wp-content/plugins directory.

or

2. Upload Plugin in WordPress Admin

In WordPress Admin Panel go to Plugins > Add New > Upload Plugin and upload .zip plugin file.


3. Active plugin

In WordPress Admin Panel go to Plugins > Installed Plugins.

Select "Lana Login with Telegram Passport" theme and click Activate button.

Plugin files

"Lana Login with Telegram Passport" plugin: /lana-telegram-passport-login.zip



Overview

Lana Login with Telegram Passport general overview

"Lana Login with Telegram Passport" allows to use the data stored in Telegram Passport when logging in to WordPress. It's a convenient and secure way to log in to WordPress.


The Log In with Telegram Passport button at the WordPress login.


The Log In with Telegram Passport button at the user profile.



Settings

Lana Login with Telegram Passport settings

Telegram Bot Settings

Bot Token: You can set the "Bot Token" which identifies and manages your Telegram Bot.
For this you need to create a Telegram Bot.

Bot ID: The plugin sets it automatically using the Bot Token.


Telegram Bot Encryption Keys Settings

Telegram Passport needs encrypted keys, you can manage and upload new keys or generate new keys.


Auth Button Settings

Display in Login page: You can set the display status of the auth button in the Login page.
options: Disabled, Enabled
default: Enabled

Display in Register page: You can set the display status of the auth button in the Register page.
options: Disabled, Enabled
default: Enabled


Request Telegram Passport Data Settings

Configure what data Telegram Passport requests from the user.

Identity: Personal Details
More option: name in the language of the user's country of residence
You can set Telegram Passport to request the user's name.

Address: Residential Address
You can set Telegram Passport to request the user's residential address.

Contact: Phone Number
You can set Telegram Passport to request the user's phone number.

Contact: Email
You can set Telegram Passport to request the user's email.
Note: This is highly recommended because an email address is required for WordPress users.


Login Auth Button Design Settings

Button Text: You can set the text of the login button.

Button Size: You can set the size of the login button.
options: Large, Medium, Small
default: Large

Button Border Radius: You can set the border radius size of the login button.
default: 3px



How to store the bot token as a constant

This is how you can store the Telegram Bot Token as a constant

It is possible to store the bot token in the database in the settings. However, constant storage is safer, so this is the recommended solution.


1. Open wp-config.php

Open the wp-config.php file with a text editor.


2. Add bot token constant

Add the following code after the following comment:

/* Add any custom values between this line and the "stop editing" line. */

define( 'LANA_TELEGRAM_PASSPORT_LOGIN_BOT_TOKEN', '5161171968:oeUTTf0Rq7QoG0BVi6CI083oGDw0bj8Ykhw' );

Note: The constant value should be your own bot token.



How to create Telegram Bot

This is how you can create Telegram Bot


1. New bot command to the Botfather

You need to type the /newbot command.

Then you need to enter the name of the bot.

Then you need to enter the username of the bot.

After that, you will receive the Bot Token.


2. Generate New Encryption Keys in WordPress plugin

You need to click the "Generate New Encryption Keys" button in Lana Telegram Passport Login "Settings" page.


3. Download Public Key File from WordPress plugin

You need to click the "Download File" button at "Bot Public Key" in Lana Telegram Passport Login "Settings" page.


4. Copy Public Key

You need to open the downloaded "public_key.pem" file.

After that, you need to copy the file content.


5. Set public key command to the Botfather

You need to type the /setpublickey command.

If you have more than one bot, you have to choose the bot.

Then you need to enter the generated public key.


6. Get Webhook Status

You need to click the "Get Status" button in Lana Telegram Passport Login "Settings" page.

This checks the Telegram Bot webhook status.

Note: if the webhook is not set, it is set using a request.



Credits