dimtion / Shaarlier

Simple Android app for sharing links on Shaarli.
GNU General Public License v3.0
97 stars 11 forks source link

Username or password incorrect on latest version of Shaarli #42

Closed GitHubGeek closed 3 years ago

GitHubGeek commented 4 years ago

Hi!

Thanks for making this awesome Android app - Love the simplicity!

Recently I've upgraded to the latest Shaarli docker master branch (docker pull shaarli/shaarli:master). Now when I re-add the account in Shaarlier, my username and password are not accepted after tapping "Try and Save".

How do I debug this issue? I've tried clearing app data but issue persist.

Thanks again

bes1967 commented 4 years ago

Hi! This is a really great app. But the same issue here. I can login to shaarli from mobile or desktop browser, but not from the app. And this behavior has been going on since I've upgraded to the latest Shaarli docker master branch (shaarli/shaarli:master). Today I've updated docker image once more, new version has been pulled, but nothing has changed - no login from app. No matter what you are trying to do - to add new bookmark (through sharing), or just to push "Try it" button in account settings. Thanks.

ArthurHoaro commented 4 years ago

Hi guys, I've started to work on the next Shaarli version which will use Slim framework controllers instead of legacy request router. Therefore, /?do=login now redirects to /login on the master branch. Since this app does not use the REST API, I think this might be why you encounter this issue.

bes1967 commented 4 years ago

ArthurHoaro, thanks. I was thought the problem is that the application is not using REST API. I've read somewere that the author plans to use API while developing version 2.0. Let's hope that it will be so. So far I decided to try Stakali

dimtion commented 4 years ago

Hi guys!

Thank you for bringing this up to my attention.

Please excuse the late response, I don't have that much time to give to Shaarlier, but you should at least have an update about the state of the project.

@ArthurHoaro is right about the cause of the issue, Shaarli have made some changes on how the urls are handled, and since the application is not using any API Shaalier needs an update to handle those new API urls. This was a design decision made way back when the Rest API did not exist.

Before that braking change, updating to the Shaarli RestAPI was a bit of work (namely rewrite the network manager), but there were no real incentive, apart from integrating more features, to make the work. Now that this is breaking the interface for some users I shall at least spend some time upgrading that part of the app.

However I cannot guarantee you any timeline, I work mostly on this project when I have the motivation, but I would be pleased for any PR helping in this direction.

In the mean time you could use Stakali, it looks like a great app, but unfortunately it is not a Free and Open Source Software.

bes1967 commented 4 years ago

@dimtion, it’s good to hear from you that you have plans to spend time implementing the client for the Shaarli REST API. Yes, Stakali, unfortunately, is not an open source project, and the author is not going to make it open source. In addition, the free version has some limitations. So I hope we'll see a new version of Shaarlier ... someday ;)

GitHubGeek commented 4 years ago

Thanks a lot for the reply. I've downgraded* to the latest docker image and got Shaarlier working again.

Thanks again, Loïc & Arthur, for your FOSS projects Shaarlier & Shaarli. 🍻

(*) Be sure to export all bookmarks before downgrade as the data store isn't compatible.

dimtion commented 4 years ago

@ArthurHoaro I was looking a bit on how I could implement the the API in Shaarlier, and it seems that external plugins such as Shaarli2Twitter or Shaarli2Mastodon are not supported yet by the Rest API.

Since these features are quite popular in Shaarlier users, and before I open an issue, do you have any information if there is any plan for opening the API to toggle external plugins features?

dimtion commented 4 years ago

Hey guys,

I had a bit of time to work on this matter during this week, and drafted a new version of Shaarlier that uses Shaarli API. Would you have a bit of time to test and give me feedback on this version? You can download it from the releases tab of Github: https://github.com/dimtion/Shaarlier/releases/tag/v1.7.0a

Once installed, you'll need to go to your account settings and set a valid Rest API Key.

There are still some limitations, such as tweets and toots that don't work. Since I'm not sure how to handle those plugins without any change to Shaarli API.

Before doing a full rollout, I'd like to improve the account configuration UX, since right now it might be a bit confusing that the combo username / password is mutually exclusive with the use of the API key (with the API key having the priority).

nikonakoneko commented 4 years ago

The share dialog disappear instantly and go back to setting like in this screen cast

dimtion commented 4 years ago

Hi @soratobukuroneko,

Thank you for the screencast, if I'm not mistaking you have no Shaarli account configured. If not done I would suggest to click on "Add account" on the main screen.

Let me know if you already did that, in which case it looks like a weird bug.

nikonakoneko commented 4 years ago

I did that but then it returns to the main screen like if I had no account

dimtion commented 4 years ago

Oh, ok I'll look into it.

On Mon, 16 Mar 2020, 09:10 Andrea Blankenstijn, notifications@github.com wrote:

I did that but then it returns to the main screen like if I had no account

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dimtion/Shaarlier/issues/42#issuecomment-599622757, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO7SRQWSP3A7DYZX4BXNNDRHZFNRANCNFSM4KYZ3OEA .

GitHubGeek commented 4 years ago

Thanks so much for the update 🥇 ! It's now on F-Droid. :

Upgraded and did a quick test against Shaarli 0.11.1 - Saving links is working.

Will upgrade shaarli server to master and test again when I find some time.

dimtion commented 4 years ago

Thank you @GitHubGeek! I'll try to finalize this issue before posting it on the AppStore.

@soratobukuroneko I was not able to reproduce your issue.

Some questions, to help me find the issue

I'm sorry for the inconvenience!

nikonakoneko commented 4 years ago

I can give you access to my shaarli instance if you want

frdrcv commented 4 years ago

Hi everyone! I'm a new shaarli and shaarlier user and I've the same problem as @soratobukuroneko on my LG-H873 running Android 9 H87330b. I'm running my own instance of shaarli. I've tried the same steps as @soratobukuroneko without success.

dimtion commented 4 years ago

Hi @frdrcv ,

I've discussed with @soratobukuroneko in private to find out the source of the issue and it was due to his webhosting provider putting a Javascript challenge in every webpage, including the REST API endpoints.

You might want to check that the your internet provider doesn't do the same.

Also, are you on Shaarli 1.7.2? On this version I've added a clearer error message that might help you find out the origin of the issue. However if the application still crashes on your device this might be another bug of the application.

frdrcv commented 4 years ago

Salut @dimtion, Since yesterday I made some google searches and stumbled upon this blog post: https://ideatrash.net/2019/01/recommended-shaarli-stakali-and-your-cloud-bookmarks.html Adding VirtualHost config file didn't solve the problem, though now I do have an error message when I try to configure shaarlier. It says I'm not using a valid shaarli URL. I just sent you the bug report by email (I don't want to make my shaarli URL public). Thanks for your work and help.

frdrcv commented 4 years ago

Oh, and concerning your last reply, if that's ok with you, I'll wait until you have the time to take a look at the bug report I sent you to contact my internet provider.

dimtion commented 4 years ago

hi @frdrcv ,

Thank you for taking the time to figure this out together. I'm sorry to inform you that I did not receive any bug report email (even in my junk folder). Are you sure the email was correctly sent? If the email still does not work for some reason, could you post here the generated report (body of the email) with any information you find personnal stripped away?

In the mean time, could you provide some information about your setup:

frdrcv commented 4 years ago

Strange, I just sent it again, maybe I actually forgot to send it yesterday while I was writing my last message here.

In all cases, here's the report :

-----BEGIN REPORT----- Report type: DEBUG Android version: 9 App version: 1.7.2 Activity: com.dimtion.shaarlier.activities.AddAccountActivity@a9fd9ae2020-04-07T15:37Z

TOKEN ERROR

java.lang.Exception: TOKEN ERROR

-----EXTRA----- Url Shaarli: http://****.dns.com/shaarli/ -----END REPORT-----

Thanks for your time!

eisengrau commented 4 years ago

Hello,

Same issue as above.

-----BEGIN REPORT----- Report type: DEBUG Android version: 10 App version: 1.7.2 Activity: com.dimtion.shaarlier.activities.AddAccountActivity@c58b32c2020-06-15T03:05Z

TOKEN ERROR

java.lang.Exception: TOKEN ERROR

-----EXTRA----- Url Shaarli: https://****.****.com/shaarli/ -----END REPORT-----

Looks like it is something to do if shaarli is served under a subdir on apache (domain/shaarli).

Else, using LineageOS 17.1 official/ Android 10, Galaxy S9, installed Shaarlier from F-droid.

dimtion commented 4 years ago

Hey guys, sorry for the late response,

I'm trying to reproduce the issue on my side, however I cannot find the correct setup that trigger that error. @frdrcv @eisengrau @soratobukuroneko Could you help me with info about your Shaarli instance, namely:

If from a terminal you do the following and have a similar result (HTTP 404), it means that your Shaarli version either is not compatible with the token authentication, or the API is disabled (if you don't have curl, you can do the same in your web browser:

curl https://shaarli-dev.dimtion.fr/api/v1/info

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.38 Server at shaarli-dev.dimtion.fr Port 443</address>
</body></html>

For example, here is the curl result for a working Shaarli instance:

curl https://shaarli.dimtion.fr/api/v1/info
{
    "message": "Not authorized: Invalid JWT header",
}

Thank you again for your help