Closed izyspania closed 1 year ago
that's kind of a cool idea. putting a flag on users that blocks website access might be a good addition.
There isn't a method for registration but i think that's not a big jump to add. I would probably have an admin 'key' that is hashed in the request so when your app generates a request it's not something people can just spam servers
it is a goal that eventually everything you can do on the website is something you can do as an API user
The only way I know right now is to use LDAP as your backend authentication. The LDAP system will create the user with some default access IF the user exists in the backend LDAP server and works via the API or the web interface. Turning off web access is interesting as well.
This really is only useful in situations where you are providing the Ampache service (and others) where it makes sense to have an LDAP backend. For me, I've tied Ampache to my email service which uses LDAP for its user database. That means my users who have never signed into Ampache can use a remote app like Dsub (uses Subsonic API) to sign in, and it will auto create the user (if the settings in ampache.cfg.php) and give them access to content.
I will explore the LDAP method , i never used LDAP method before. I am using Subsonic API on my app too but i can switch to Ampache API if needed. I dont want to use the ampache web interface as my app its audiobook oriented and ampache is not , so i just want to use it as a server , i can build my own version of website if i want a web version using the API instead of messing with the Ampache code to make it suite my needs.
So what would be nice to have is:
The LDAP solution is not for the faint of heart. In fact, I would only recommended using it IF you already have an LDAP server that you use to authenticate users. That method, since it's a plugin for Ampache authentication, should work for all APIs available (Ampache, Subsonic or otherwise).
I'm not sure about those other features, but usually for LDAP, most applications do NOT do a "forgotten password" method simply because there is often another server where that is done. For instance, since my LDAP server is installed with my email system, my email clients have a way to reset a forgotten password. Since the password is the same for all my LDAP backed applications, if the user has forgotten their Ampache password, then that user is not likely able to log in and get email either and will use that to reset the password.
i've added a method to allow api registration now with eeda7bcce will need to do some testing with it but should allow user registration, email verification, etc the same as the website register pages
Thats great , i will test it out.
Edit: Any chance you can add it to the subsonic API too?
is there a method in subsonic that allows reg?
In subsonic API specs there is a method for admins to add a user but not registrations , anyway it will be a nice touch to have that even if its out of spec , my app was built with subsonic API and would be faster and easier to implement registration in the app with subsonic API (maybe there are others in the same situation).
if the group extending subsonic in symphonium want to add one too i'll implement it https://support.symfonium.app/t/expanding-subsonic-api/1115
Is there any way users can register via API? The use case is that i have an android app and i want to let people register from it (and i dont want to include an admin user in the app to use the API for security reasons). Also would be nice to have an option to disable user access on the website and only give them access with the api (from my android app). Edit: + an forgot password API
Thanks