mitchray / ample

A simple web browser client for Ampache
https://ample-player.vercel.app/
GNU Affero General Public License v3.0
63 stars 13 forks source link

Add Remember Me Feature #44

Closed mediadev123 closed 1 year ago

mediadev123 commented 1 year ago

Hey,

is there any way that you can implement a remember me feature? I constantly get logged out of ample and it would be awesome if I didn't have to type my password everytime.

Thanks in advance!

mitchray commented 1 year ago

I feel your pain, right now there isn't a way unless the password is stored in plaintext which to me isn't a great option...

There have been recent discussions in Ampache about adding a new perma-auth token which would allow you to remain logged in to clients like Ample, so hopefully that is implemented soon

mediadev123 commented 1 year ago

Wow thanks for that information. I suppose my mobile client is also saving my password in plaintext, which isn't great... That being said, I can see two ways to "bypass". Maybe there is a way to generate (if necessary) and query and API key from the backend.

Alternatively, couldn't you just perma save the API key in the client if you login with the API key, as saving the API key isn't that big of a deal.

Thanks for creating this great app though. It looks great and is very easy to use.

mitchray commented 1 year ago

I already attempted to use a saved API key but it wasn't very reliable so I shelved it for another day https://github.com/mitchray/ample/commit/8be8a46c7aa085f60c2fc35a8731fc0878164512

Its definitely a QOL improvement to have in the future

mediadev123 commented 1 year ago

What exactly was the issues with that commit? Do you have any idea what made it unreliable? I would like to help-out if I can

mitchray commented 1 year ago

I'm going to close but will potentially revisit if/when the Ampache API is updated to allow this

rstefko commented 8 months ago

I would like to re-open this issue to reconsider the option to store credentials in local storage. With owncloud music you generate an API password but still it is username / password login (not api key without expiration). Maybe it could be enabled by a config option?

yigitkonur commented 8 months ago

I completely agree. It keeps signing me out every 30 seconds, making this project unworkable for me. @mitchray, could we possibly address this issue? Is there an option to increase the sign-in duration? I've set up a read-only API in an attempt to fix this, but I'm still getting signed out.

mitchray commented 8 months ago

Ampache 6.2.0 added an option for API sessions to never expire: perpetual_api_session

Enable that and you should be good

rstefko commented 8 months ago

@paulijar is it possible to increase session in ownCloud music?

paulijar commented 8 months ago

For ownCloud Music, the expiry time is currently 6000 seconds (1 hour 40 minutes). The timer is renewed whenever there is an authorized API call. I don't think it should run out while you are actually using the client. But maybe I could make this a configurable value.

What the Ample client could make to improve the situation, would be to ping the API every now and then. With that, the session should not time out while the web page is open even in case the user is not actively using it.

mitchray commented 8 months ago

Ample already does that every 15 minutes

https://github.com/mitchray/ample/blob/9c73ce7960b92b0e1864fc9fa58cc3d764af8b28/src/App.svelte#L38

rstefko commented 8 months ago

In my case Ample does not logout while being used. Increasing the sessions expiration would help in my case. I will try to edit the code on my side and test. Thanks

rstefko commented 8 months ago

Increasing the session helped, @paulijar it would great to have ability to configure session expiration for API in ownCloud Music.

paulijar commented 8 months ago

@rstefko I created the issue https://github.com/owncloud/music/issues/1134 for ownCloud Music about this feature request.

saibaaimo commented 2 weeks ago

@mitchray Could you perhaps make API key field a password field? Users could then be able to store the key in their (browser) password manager and easily enter.

mitchray commented 1 week ago

@saibaaimo Added with https://github.com/mitchray/ample/commit/fa570483cccf63172eaeee834a59d6856d1d09b5

saibaaimo commented 1 week ago

@mitchray excellent, works well, thank you! :-)