The package com.github.badoualy.telegram.mtproto.auth contains classes needed to do all the work to create a new authorization key following Telegram's documentation specifications.

To create a new authorization key, you can just call:

DataCenter prodDC4 = new DataCenter("", 443);
AuthResult authResult = AuthKeyCreation.createAuthKey(prodDC4);

// AuthResult contains the active connection, close it if you're not using it :)
if (authResult != null)

Here is the list of production datacenters:

DataCenter prodDC1 = new DataCenter("", 443);
DataCenter prodDC2 = new DataCenter("", 443);
DataCenter prodDC3 = new DataCenter("", 443);
DataCenter prodDC4 = new DataCenter("", 443);
DataCenter prodDC5 = new DataCenter("", 443);


Api module

If you're using the whole library, don't hardcode those values, they're already present in the Kotlogram class. See the module's documentation for more details.

Did this page help you?