OpenArchive / Save-app-android-old

This is the Save app for Android
https://open-archive.org
GNU General Public License v3.0
94 stars 25 forks source link

Internet Archive login not working #496

Closed uniqx closed 7 months ago

uniqx commented 1 year ago

Describe the bug

I'd like to log into my internet archive test account. But I can't seem to get it to work.

To Reproduce Steps to reproduce the behavior:

  1. prepare a archive account
  2. get a fresh install of Save (Android emulator api level 30)
  3. select "Internet Archive" when choosing a Space to connect to
  4. tap "Acquire Keys" Button
  5. enter email address and password from previously prepared Internet Archive account
  6. wait for scraper to finish and fill in the forms
  7. tap "next"
  8. Error Message: Incorrect username or password

Expected behavior

I would have expected to get logged in, instead of ending up with an error message.

I've also checked what the scraper fills into into the forms (Access Key + Secret Key). The values match what's displayed to me when use a web browser to login and look at: https://archive.org/account/s3.php

Screenshots

image

tladesignz commented 1 year ago

Ok, so as evaluated during our call: There must be some difference between accounts on Internet Archive's side. @hiromipaw to contact IA and clarify.

tladesignz commented 11 months ago

To clarify this:

It seems, the API keys, one can grab on https://archive.org/account/s3.php of newly created accounts don't work on https://s3.us.archive.org. Whereas with older accounts, it's no problem.

This points to some syncing problem on archive.org's side.

uniqx commented 10 months ago

I've went through the flow again, still the same issue:

As you can see: the keys match, yet our login doesn't work. To be more specific, the error message in our user interface only show up when we receive a HTTP response with status code 401. So it's safe to say, that the open archive API at https://s3.us.archive.org doesn't accept the access and secret keys of the user savetest1@h4x.at.

(Note: I've hit the "destroy keys" button after taking screenshots)

ceylana commented 9 months ago

Confirming that this is still an issue. I'm able to create a new IA login, then, after I verify the email outside the app and login, it populated my keys but then says they are incorrect.

signal-2024-01-02-152535_002

foundscapes commented 9 months ago

@tladesignz can you help @uniqx since this is working fine on iOS so doesn't seem to be an IA problem right?

tladesignz commented 9 months ago

@uniqx, as per your mail from 2023-11-21:

Hi again,

I did some more debugging of our legacy code. I've logged one of my authentication requests and build a curl request based on that:

$ curl https://s3.us.archive.org/ --header "Authorization: LOW xxxxx:yyyyy"
<?xml version='1.0' encoding='UTF-8'?>
<ListAllMyBucketsResult><Owner><ID>OpaqueIDStringGoesHere</ID><DisplayName>Readable ID Goes > Here</DisplayName></Owner><Buckets /></ListAllMyBucketsResult>

This is the exact response you get with completely invalid credentials.

With the structure of the Internet Archive S3 server, as it is, there is no way to test if credentials are correct other than writing stuff to it. Which is a really bad idea, because it is very hard to remove created buckets again. (Not automatically, that is.)

@uniqx, this is why the iOS app never implemented this in the first place and you need to please remove that check from the Android code.

uniqx commented 7 months ago

fixed in 0.3.1-alpha2

foundscapes commented 7 months ago

@purvi-ranawat please test, I was able to create a new IA account through the IA page via Save, verify it, and then acquire keys and login. See if you can use a newer account to login or do the same as I did. ty!

purvi-ranawat commented 7 months ago

@foundscapes : This is working fine with the new IA account which I have created through Save app.

Environment :

OS : Android 14 Device : OnePlus Nord 3 CE Lite, Samsung Galaxy A13 Build version : 0.3.1-alpha2

foundscapes commented 7 months ago

@tladesignz do we need to test anything else before closing this issue?

tladesignz commented 7 months ago

@tladesignz do we need to test anything else before closing this issue?

No.