Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTH_BYTES_INVALID when call Auth_ImportAuthorization #289

Closed
nguyentuan3691 opened this issue Sep 23, 2024 · 4 comments
Closed

AUTH_BYTES_INVALID when call Auth_ImportAuthorization #289

nguyentuan3691 opened this issue Sep 23, 2024 · 4 comments
Labels
invalid Issue seems invalid, on user side, or unrelated to project

Comments

@nguyentuan3691
Copy link

Hello

When I'm test this code
`var client = new WTelegram.Client(Config);
await client.ConnectAsync();
await client.Users_GetUsers(InputUser.Self);

var authData = await client.Auth_ExportAuthorization(1);

var result = await client.Auth_ImportAuthorization(authData.id, authData.bytes);
`
Auth_ImportAuthorization throw exception

TL.RpcException
HResult=0x80131600
Message=AUTH_BYTES_INVALID
Source=WTelegramClient
StackTrace:
at WTelegram.Client.d__129`1.MoveNext()
at Program.<

$>d__0.MoveNext() in D:\Projects_2024\Telegram.AirDrop\Telegram.GetSession\Program.cs:line 28
image

@wiz0u
Copy link
Owner

wiz0u commented Sep 23, 2024

There are so many wrongs in this code.
What are you trying to achieve exactly?

@nguyentuan3691
Copy link
Author

While researching telegram api
I found that api Auth.ExportAuthorization Auth.ImportAuthorization can transfer login session from one machine to another very quickly without logging in. I want to test it.
I exported the data to a file and then initialized an empty session, then imported it but it still failed
Where is my code wrong?

@wiz0u
Copy link
Owner

wiz0u commented Sep 23, 2024

That is not what these methods do. They transfer session authorization to another DC among Telegram Data Centers. Not at all to be used on another of YOUR machines.

These methods are mostly used for downloading files residing on a different Data Center than the Main DC for your account. You shouldn't have to call them as WTelegramClient automatically handles this when you use DownloadFileAsync

@wiz0u wiz0u closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
@wiz0u wiz0u added the invalid Issue seems invalid, on user side, or unrelated to project label Sep 23, 2024
@nguyentuan3691
Copy link
Author

thanks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid Issue seems invalid, on user side, or unrelated to project
Projects
None yet
Development

No branches or pull requests

2 participants