Link Search Menu Expand Document

Method: auth.exportLoginToken

Back to methods index

Generate a login token, for login via QR code.
The generated login token should be encoded using base64url, then shown as a tg://login?token=base64encodedtoken deep link » in the QR code.

For more info, see login via QR code.

Parameters:

NameTypeDescriptionRequired
api_idintApplication identifier (see. App configuration)Optional
api_hashstringApplication identifier hash (see. App configuration)Optional
except_idsArray of longList of already logged-in user IDs, to prevent logging in twice with the same userYes

Return type: auth.LoginToken

Can bots use this method: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$auth_LoginToken = $MadelineProto->auth->exportLoginToken(api_id: $int, api_hash: 'string', except_ids: [$long, $long], );