{"_id":"57e0f834632fd4220007a566","version":{"_id":"5703d527bb69fc1700553ce3","hasDoc":true,"__v":6,"hasReference":true,"project":"5703d527bb69fc1700553ce0","createdAt":"2016-04-05T15:09:27.620Z","releaseDate":"2016-04-05T15:09:27.620Z","categories":["5703d527bb69fc1700553ce4","5703d8b7aceacc17003ef303","5703e60b6116142000db25f6","57e0db616a1c2e0e0081fe64","57e0f141ff540c22007b45fa","57e0f14b8929550e00f1d9bc"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.6","version":"0.0.6"},"category":{"_id":"57e0f141ff540c22007b45fa","version":"5703d527bb69fc1700553ce3","__v":0,"project":"5703d527bb69fc1700553ce0","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-20T08:20:17.405Z","from_sync":false,"order":3,"slug":"mtproto-module","title":"MTProto module"},"project":"5703d527bb69fc1700553ce0","parentDoc":null,"user":"5631f962c3b04b0d00ba9bf1","__v":0,"githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-20T08:49:56.509Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"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.\n\nTo create a new authorization key, you can just call:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DataCenter prodDC4 = new DataCenter(\\\"149.154.167.91\\\", 443);\\nAuthResult authResult = AuthKeyCreation.createAuthKey(prodDC4);\\n\\n// AuthResult contains the active connection, close it if you're not using it :)\\nif (authResult != null)\\n    authResult.getConnection().close();\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nHere is the list of production datacenters:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DataCenter prodDC1 = new DataCenter(\\\"149.154.175.50\\\", 443);\\nDataCenter prodDC2 = new DataCenter(\\\"149.154.167.51\\\", 443);\\nDataCenter prodDC3 = new DataCenter(\\\"149.154.175.100\\\", 443);\\nDataCenter prodDC4 = new DataCenter(\\\"149.154.167.91\\\", 443);\\nDataCenter prodDC5 = new DataCenter(\\\"91.108.56.165\\\", 443);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Api module\",\n  \"body\": \"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.\"\n}\n[/block]","excerpt":"https://core.telegram.org/mtproto/auth_key","slug":"authkey-creation","type":"basic","title":"AuthKey creation"}

AuthKey creation

https://core.telegram.org/mtproto/auth_key

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: [block:code] { "codes": [ { "code": "DataCenter prodDC4 = new DataCenter(\"149.154.167.91\", 443);\nAuthResult authResult = AuthKeyCreation.createAuthKey(prodDC4);\n\n// AuthResult contains the active connection, close it if you're not using it :)\nif (authResult != null)\n authResult.getConnection().close();", "language": "java" } ] } [/block] Here is the list of production datacenters: [block:code] { "codes": [ { "code": "DataCenter prodDC1 = new DataCenter(\"149.154.175.50\", 443);\nDataCenter prodDC2 = new DataCenter(\"149.154.167.51\", 443);\nDataCenter prodDC3 = new DataCenter(\"149.154.175.100\", 443);\nDataCenter prodDC4 = new DataCenter(\"149.154.167.91\", 443);\nDataCenter prodDC5 = new DataCenter(\"91.108.56.165\", 443);", "language": "java" } ] } [/block] [block:callout] { "type": "info", "title": "Api module", "body": "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." } [/block]