rmcrackan / Libation

Libation: Liberate your Library
GNU General Public License v3.0
2.78k stars 152 forks source link

Feature request: editing the email/username of a logged in account should prompt a new log in #966

Closed Sod-Almighty closed 2 months ago

Sod-Almighty commented 2 months ago

I have successfully exported all the books on my account. However, when I try to do the same for my wife's account......nothing happens.

  1. I moved the downloaded audiobooks (from my own account) out of the download directory I had configured for this program to use.
  2. I went into Settings->Accounts and replaced my email address and locale with those for my wife's account.
  3. I then went to Import->Scan Library.
  4. I was asked for the password. I entered it.
  5. Nothing happened.

"No books. Begin by importing your library" is displayed at the bottom right of the window.

Expected behaviour My wife's books should have been loaded and displayed.

Screenshots Prism Microsoft Remote Desktop, Today at 1 05 43 pm

Platform Linux Mint 21.3 64bit.

Log Files

2024-08-26 12:57:03.479 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.resources, Version=7.0.12.0, Culture=en-GB, PublicKeyToken=adb9793829ddae60 {}2024-08-26 12:57:03.506 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.resources, Version=7.0.12.0, Culture=en, PublicKeyToken=adb9793829ddae60 {}2024-08-26 12:57:03.565 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Windows, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime {}2024-08-26 12:57:03.573 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.Windows.SDK.NET, Culture=neutral, PublicKeyToken=null {}2024-08-26 12:57:04.038 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.Relational.resources, Version=7.0.12.0, Culture=en-GB, PublicKeyToken=adb9793829ddae60 {}2024-08-26 12:57:04.040 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.Relational.resources, Version=7.0.12.0, Culture=en, PublicKeyToken=adb9793829ddae60 {}2024-08-26 12:57:04.503 +01:00 [ERR] (at LibationAvalonia.FormSaveExtension.RestoreSizeAndLocation(Avalonia.Controls.Window, LibationFileManager.Configuration)) Failed to save MainWindow size and location System.NullReferenceException: Object reference not set to an instance of an object. at LibationAvalonia.FormSaveExtension.RestoreSizeAndLocation(Window form, Configuration config) in /home/runner/work/Libation/Libation/Source/LibationAvalonia/FormSaveExtension.cs:line 45 {"ExceptionDetail":{"Type":"System.NullReferenceException","HResult":-2147467261,"Message":"Object reference not set to an instance of an object.","Source":"Libation","TargetSite":"Void RestoreSizeAndLocation(Avalonia.Controls.Window, LibationFileManager.Configuration)"}}2024-08-26 12:57:25.142 +01:00 [ERR] (at ApplicationServices.LibraryCommands+d__17.MoveNext()) Failed to scan account AudibleApi.Authentication.LoginFailedException: No matching result page type at AudibleApi.Authentication.LoginResultRunner.getResultsPageAsync(Authenticate authenticate, Dictionary2 inputs, HttpResponseMessage response) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/LoginResultRunner.cs:line 48 at AudibleApi.Authentication.LoginResultRunner.GetResultsPageAsync(Authenticate authenticate, Dictionary2 inputs, HttpMethod method, String url) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/LoginResultRunner.cs:line 26 at AudibleApi.Authentication.CredentialsPage.SubmitAsync(String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/CredentialsPage.cs:line 22 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 85 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(Locale locale, String deviceName, String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 56 at AudibleApi.EzApiCreator.loginEmailPasswordAsync(Locale locale, ILoginCallback responder, String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/EzApiCreator/EzApiCreator.LoginCallback.cs:line 51 at AudibleApi.EzApiCreator.choiceLoginAsync(Locale locale, ILoginChoiceEager loginChoiceEager) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/EzApiCreator/EzApiCreator.LoginChoiceEager.cs:line 50 at AudibleApi.EzApiCreator.GetApiAsync(ILoginChoiceEager loginChoiceEager, Locale locale, String identityFilePath, String jsonPath) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/EzApiCreator/EzApiCreator.LoginChoiceEager.cs:line 28 at AudibleUtilities.ApiExtended.CreateAsync(Account account, ILoginChoiceEager loginChoiceEager) in /home/runner/work/Libation/Libation/Source/AudibleUtilities/ApiExtended.cs:line 36 at LibationAvalonia.Dialogs.Login.AvaloniaLoginChoiceEager.ApiExtendedFunc(Account account) in /home/runner/work/Libation/Libation/Source/LibationAvalonia/Dialogs/Login/AvaloniaLoginChoiceEager.cs:line 14 at ApplicationServices.LibraryCommands.scanAccountsAsync(Func`2 apiExtendedfunc, Account[] accounts, LibraryOptions libraryOptions) in /home/runner/work/Libation/Libation/Source/ApplicationServices/LibraryCommands.cs:line 250 {"ExceptionDetail":{"HResult":-2146233088,"Message":"No matching result page type","Source":"AudibleApi","TargetSite":"Void MoveNext()","RequestUrl":"https://www.amazon.co.uk/ap/cvf/request?arb=934e0417-910b-4918-bc70-50cc4023f9d0","ResponseStatusCode":"OK","ResponseInputFields":{"cvf_captcha_captcha_token":"BdalIjZxHYvrviCqf39/fwAAAAAAAAABGvnLZTO0BJPMN4cTh0p4yp05CWLWBYB/02aV2wn8Lh6p+lkUbuEcOrIZXNI8UworH/GtIM9kBpccfKxF8vEQSQSuNRmIpAI9ipbT9M49HNnsHwKwqchXOAV0xCW5Aiaik+fX7clp+GNQnumPCXO9GKwzrWAkEst4ddcqH1Ks6nDZmLXUFgUV/OSRm3d65Jr5SAm3N9kovu5UNSmbZoOPkn6Qkl+pmiZXOzGxDiUN0HJQAU1iKGj9FzBGFDCC/iNx0pZIDP6bOTASnCXew6NNudq3090D7TSDv7sBRxUg5slOG0s9wJlEkUeLhWuqwVaxw1WKGsvpyOS5","cvf_captcha_captcha_type":"imageCaptcha","cvf_captcha_js_enabled_metric":"0","clientContext":"258-5462612-0753532","openid.pape.max_auth_age":"0","forceMobileLayout":"1","accountStatusPolicy":"P1","openid.identity":"http://specs.openid.net/auth/2.0/identifier_select","marketPlaceId":"A2I9A3Q2GNFNGQ","pageId":"amzn_audible_ios","openid.return_to":"https://www.amazon.co.uk/ap/maplanding","openid.assoc_handle":"amzn_audible_ios_uk","openid.oa2.response_type":"code","openid.mode":"checkid_setup","openid.ns.pape":"http://specs.openid.net/extensions/pape/1.0","openid.ns.oa2":"http://www.amazon.com/ap/ext/oauth/2","openid.oa2.code_challenge_method":"S256","openid.oa2.code_challenge":"d7M3-YkOfdfkScarMW5JdMhn79dPmRrhEyBZTet_o8c","openid.oa2.scope":"device_auth_access","openid.claimed_id":"http://specs.openid.net/auth/2.0/identifier_select","openid.oa2.client_id":"device:4641313034413732324643383438333141323532443830424144363841454346234132435a4a5a474c4b324a4a564d","openid.ns":"http://specs.openid.net/auth/2.0","shouldShowPersistentLabels":"true","verifyToken":"s|04357873-c2d2-3c87-afe6-6f8bccd05157","cvf_captcha_input":null,"cvf_captcha_captcha_action":"verifyCaptcha"},"ResponseBodyFilePaths":[],"Type":"AudibleApi.Authentication.LoginFailedException"}}

Sod-Almighty commented 2 months ago

Uh.....actually that sounds way dodgy. Suppose I don't do that?

EDIT: Unsurprisingly the linked file contains a trojan. I have reported both of your accounts as malicious.

rmcrackan commented 2 months ago

Sorry for the confusion. After you successfully logged in with your account, it didn't retry the other account because Libation thought it had already succeeded. You can add multiple account then each one will need to log in separately. Sorry -- it didn't occur to me that users would create an account entry, login, then edit it. It makes sense now that I think about it though.

I'm going to edit this ticket a bit and tag it an enhancement request to handle situations like this. Thanks for reporting it.

Sod-Almighty commented 2 months ago

But it did prompt me for the password. And I tried deleting the account entry and adding it again.

rmcrackan commented 2 months ago

Now I'm worried I got you into a weird state somehow. If all else fails you can delete your AccountSettings.json file and restart Libation. That will for sure blow away all logins and let you start over. It's a bit extreme though. You should be able to add new entries and get prompted for login. Is there one account in particular giving trouble? Maybe there's something different about that account.

Sod-Almighty commented 2 months ago

Well, one account worked and the other one does not. I don't have any other accounts to test against. I will rename the JSON file and see if the problem goes away. Then we can see if it's an account issue or not.

Sod-Almighty commented 2 months ago

The books still will not populate. I am prompted for the password (as I was before) but after that nothing happens.

rmcrackan commented 2 months ago

Can you drop your latest log file into this ticket?

Sod-Almighty commented 2 months ago

Sure. Looks very similar to the previous:

2024-08-26 22:31:50.443 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.resources, Version=7.0.12.0, Culture=en-GB, PublicKeyToken=adb9793829ddae60 {}2024-08-26 22:31:50.695 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.resources, Version=7.0.12.0, Culture=en, PublicKeyToken=adb9793829ddae60 {}2024-08-26 22:31:51.225 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Windows, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime {}2024-08-26 22:31:51.244 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.Windows.SDK.NET, Culture=neutral, PublicKeyToken=null {}2024-08-26 22:31:51.818 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.Relational.resources, Version=7.0.12.0, Culture=en-GB, PublicKeyToken=adb9793829ddae60 {}2024-08-26 22:31:51.827 +01:00 [ERR] (at LibationFileManager.InteropFactory.CurrentDomain_AssemblyResolve(System.Object, System.ResolveEventArgs)) Unable to load module Microsoft.EntityFrameworkCore.Relational.resources, Version=7.0.12.0, Culture=en, PublicKeyToken=adb9793829ddae60 {}2024-08-26 22:31:52.907 +01:00 [ERR] (at LibationAvalonia.FormSaveExtension.RestoreSizeAndLocation(Avalonia.Controls.Window, LibationFileManager.Configuration)) Failed to save MainWindow size and location System.NullReferenceException: Object reference not set to an instance of an object. at LibationAvalonia.FormSaveExtension.RestoreSizeAndLocation(Window form, Configuration config) in /home/runner/work/Libation/Libation/Source/LibationAvalonia/FormSaveExtension.cs:line 45 {"ExceptionDetail":{"Type":"System.NullReferenceException","HResult":-2147467261,"Message":"Object reference not set to an instance of an object.","Source":"Libation","TargetSite":"Void RestoreSizeAndLocation(Avalonia.Controls.Window, LibationFileManager.Configuration)"}}2024-08-26 22:31:56.818 +01:00 [ERR] (at LibationAvalonia.FormSaveExtension.RestoreSizeAndLocation(Avalonia.Controls.Window, LibationFileManager.Configuration)) Failed to save AccountsDialog size and location System.NullReferenceException: Object reference not set to an instance of an object. at LibationAvalonia.FormSaveExtension.RestoreSizeAndLocation(Window form, Configuration config) in /home/runner/work/Libation/Libation/Source/LibationAvalonia/FormSaveExtension.cs:line 45 {"ExceptionDetail":{"Type":"System.NullReferenceException","HResult":-2147467261,"Message":"Object reference not set to an instance of an object.","Source":"Libation","TargetSite":"Void RestoreSizeAndLocation(Avalonia.Controls.Window, LibationFileManager.Configuration)"}}2024-08-26 22:32:31.883 +01:00 [ERR] (at ApplicationServices.LibraryCommands+d__17.MoveNext()) Failed to scan account AudibleApi.Authentication.LoginFailedException: No matching result page type at AudibleApi.Authentication.LoginResultRunner.getResultsPageAsync(Authenticate authenticate, Dictionary2 inputs, HttpResponseMessage response) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/LoginResultRunner.cs:line 48 at AudibleApi.Authentication.LoginResultRunner.GetResultsPageAsync(Authenticate authenticate, Dictionary2 inputs, HttpMethod method, String url) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/LoginResultRunner.cs:line 26 at AudibleApi.Authentication.CredentialsPage.SubmitAsync(String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/CredentialsPage.cs:line 22 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 85 at AudibleApi.Authentication.Authenticate.SubmitCredentialsAsync(Locale locale, String deviceName, String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/Authentication/Authenticate.cs:line 56 at AudibleApi.EzApiCreator.loginEmailPasswordAsync(Locale locale, ILoginCallback responder, String email, String password) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/EzApiCreator/EzApiCreator.LoginCallback.cs:line 51 at AudibleApi.EzApiCreator.choiceLoginAsync(Locale locale, ILoginChoiceEager loginChoiceEager) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/EzApiCreator/EzApiCreator.LoginChoiceEager.cs:line 50 at AudibleApi.EzApiCreator.GetApiAsync(ILoginChoiceEager loginChoiceEager, Locale locale, String identityFilePath, String jsonPath) in /home/runner/work/AudibleApi/AudibleApi/AudibleApi/EzApiCreator/EzApiCreator.LoginChoiceEager.cs:line 28 at AudibleUtilities.ApiExtended.CreateAsync(Account account, ILoginChoiceEager loginChoiceEager) in /home/runner/work/Libation/Libation/Source/AudibleUtilities/ApiExtended.cs:line 36 at LibationAvalonia.Dialogs.Login.AvaloniaLoginChoiceEager.ApiExtendedFunc(Account account) in /home/runner/work/Libation/Libation/Source/LibationAvalonia/Dialogs/Login/AvaloniaLoginChoiceEager.cs:line 14 at ApplicationServices.LibraryCommands.scanAccountsAsync(Func`2 apiExtendedfunc, Account[] accounts, LibraryOptions libraryOptions) in /home/runner/work/Libation/Libation/Source/ApplicationServices/LibraryCommands.cs:line 250 {"ExceptionDetail":{"HResult":-2146233088,"Message":"No matching result page type","Source":"AudibleApi","TargetSite":"Void MoveNext()","RequestUrl":"https://www.amazon.co.uk/ap/cvf/request?arb=ee5658f1-39a6-4033-a915-c7b3c7112aa3","ResponseStatusCode":"OK","ResponseInputFields":{"cvf_captcha_captcha_token":"VSMT1hf0Nw0tlh74f39/fwAAAAAAAAAB9TIdIQScgH4gPqCCJDkGUj3wy9AwJipoBLg1aBTbt4wx8ujrXLDi1LYySAK/m+p1en4t91C55ACT13MG5jisvQQ9x48kH4mf2DplFximT9n2oeheG2hOfAhoUrP7lAaruDvLlK8F/cPfibJKhLB+IvI5gA8ciAT9z2P9AqU2LhlYnyt/h56zOliCI/mfTBJRynZFIBklczyx1TuyZYGAk6u4NxwWhbxELgnZno3Gg9839BsPu5Ddatt+5aO96O+U0g2HWgUKqTEkvcDfPbhcDgBmVx6cvZ9MlghUNZQtJXcwZogNcLHvCqKs9k6GQk1fhTysLtVy3vPW","cvf_captcha_captcha_type":"imageCaptcha","cvf_captcha_js_enabled_metric":"0","clientContext":"257-3212337-4044949","openid.pape.max_auth_age":"0","forceMobileLayout":"1","accountStatusPolicy":"P1","openid.identity":"http://specs.openid.net/auth/2.0/identifier_select","marketPlaceId":"A2I9A3Q2GNFNGQ","pageId":"amzn_audible_ios","openid.return_to":"https://www.amazon.co.uk/ap/maplanding","openid.assoc_handle":"amzn_audible_ios_uk","openid.oa2.response_type":"code","openid.mode":"checkid_setup","openid.ns.pape":"http://specs.openid.net/extensions/pape/1.0","openid.ns.oa2":"http://www.amazon.com/ap/ext/oauth/2","openid.oa2.code_challenge_method":"S256","openid.oa2.code_challenge":"kwlvTM_V8R6S8D3ryMQPPKu7a4HogmznKyFCebQYit4","openid.oa2.scope":"device_auth_access","openid.claimed_id":"http://specs.openid.net/auth/2.0/identifier_select","openid.oa2.client_id":"device:3745423132423439333330443445324338393039333441453536413835334433234132435a4a5a474c4b324a4a564d","openid.ns":"http://specs.openid.net/auth/2.0","verifyToken":"s|00fcfc33-05e7-3c6b-b232-24cf37c5c848","cvf_captcha_input":null,"cvf_captcha_captcha_action":"verifyCaptcha"},"ResponseBodyFilePaths":[],"Type":"AudibleApi.Authentication.LoginFailedException"}}

rmcrackan commented 2 months ago

My best guess is that it has something to do with that account. Maybe it has an extra login step which I haven't accounted for. This should work for all accounts. It's a little wonky but it by-passes Libation's code and should work for any account:

Sod-Almighty commented 2 months ago

That fixed it! Thanks!

rmcrackan commented 2 months ago

Sorry for the headache. Thank you for your patience.