YunoHost-Apps / pixelfed_ynh

The federated image shareing service Pixelfed for YunoHost
https://pixelfed.org/
GNU Affero General Public License v3.0
44 stars 15 forks source link

Ynh Pixelfed instances can't be used with apps : OAuth not enabled #140

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug

Yunohost Pixelfed instances can't be used with apps

Context

Hardware: VPS bought online: Hetzner cloud cx21 YunoHost version: 4.2.4 (stable). I have access to my server : through the webadmin Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Steps to reproduce

  1. Install a Pixelfed app (PixelDroid, Fedilap, Tusky,...) on your phone
  2. Try to log in at your yunohost pixelfed instance (or try e.g. pix.wien.rocks)

Expected behavior

You should get redirected to the pixelfed site, where you can log in and authorize the app. You actually get a "Something went wrong. We cannot process your request at this time, please try again later" error.

lapineige commented 3 years ago

Is your Pixelfed instance behind Yunohost SSO ?

ghost commented 3 years ago

It does appear in the user portal, if that is what you mean.

lapineige commented 3 years ago

It is not: if you try to connect to you instance while logged-off of Yunohost (using private mode for instance) do you have to connect to Yunohost first before accessing to Pixelfed ?

ghost commented 3 years ago

No I don't. I can log in to Pixelfed directly

lapineige commented 3 years ago

Ok, then that's probably not a SSO issue…

If I understand wheel, when you try to connect via the app, you are redirected to your instance website with that error message ?

edit: I tried, in the app I have a "Impossible to register this app on this server". I wonder if I might have disabled the API :thinking:

ghost commented 3 years ago

It's also not possible to manually create an app token. When I try and click create nothing happens. Someone else said they get a 500 error.

lapineige commented 3 years ago

Do you have any log to share about that ? I have no idea what's going wrong… :/

axac commented 3 years ago

salut, j'avais le même soucis, regarde içi : https://docs.pixelfed.org/technical-documentation/api-v1.html#authorization

Authorization We use OAuth for api authentication, you can create an OAuth app or Personal Access Token in the Account Settings on Pixelfed.

To create a personal access client :

Add OAUTH_ENABLED=true to .env

php artisan passport:keys php artisan config:cache php artisan route:cache php artisan passport:client --personal You can then create a new token on this page /settings/applications

cela a fonctionné pour moi je peux me connecter avec Pixeldroid maintenant

ghost commented 3 years ago

Thanks that worked.

But shouldn't this be enabled by default?

lapineige commented 3 years ago

But shouldn't this be enabled by default?

Well, it should be: https://github.com/YunoHost-Apps/pixelfed_ynh/blob/29f1f649ca075ea49f8f447dce43c1525c98dd41/conf/.env#L16

yalh76 commented 3 years ago

But shouldn't this be enabled by default?

Well, it should be:

https://github.com/YunoHost-Apps/pixelfed_ynh/blob/29f1f649ca075ea49f8f447dce43c1525c98dd41/conf/.env#L16

It's already enabled but php artisan passport commands are not executed

lapineige commented 3 years ago

Great, then that's an issue solved :)