auth.exportLoginToken #

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.

Layer 223

auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;
---functions---
auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;

Parameters #

NameTypeDescription
api_idintApplication identifier (see. App configuration)
api_hashstringApplication identifier hash (see. App configuration)
except_idsVector<long>List of already logged-in user IDs, to prevent logging in twice with the same user

Result #

auth.LoginToken

Only users can use this method #

This method can be invoked over an unauthenticated connection » #

Possible errors #

CodeTypeDescription
400API_ID_INVALIDAPI ID invalid.
400API_ID_PUBLISHED_FLOODThis API id was published somewhere, you can't use it now.
500AUTH_RESTARTRestart the authorization process.

Login via QR code #

QR code login flow

Telegram clients must handle special tg:// and t.me deep links encountered in messages, link entities and in other apps by registering OS handlers.