Komga, première install et sso / first install and sso

What type of hardware are you using: Virtual machine
What YunoHost version are you running: 12.0.14
What app is this about: Komga

Describe your issue

Bonjour,
j’ai installé Komga sur une VM sur ma freebox mais une fois arrivé sur la page de connexion, pas moyen de se connecter avec les identifiants de mon instance Yunohost. J’ai une erreur : Invalid authentication: Request failed with status code 401.
Je n’ai pas non plus la possibilité de créer un utilisateur.
J’ai essayé de l’installer sur un sous domaine qui lui est propre ou comme application du domaine principal mais toujours le même résultat.
Je ne serais pas contre un peu d’aide svp.
Merci d’avance.

Hello,
i installed Komga on a VM on my freebox but once arrived on the login page, no way to connect with the credentials of my Yunohost instance. Error: Invalid authentication: Request failed with status code 401.
Nor do I have the ability to create a user.
I tried to install it on a subdomain of its own or as an application of the main domain but always the same resul.
I wouldn’t be against a little help, please.
Thanks.

Share relevant logs or error messages

Bonjour,

Mêmes tests, même problème. Cela n’a pas l’air nouveau.

A retenter peut-être car pour moi c’est fonctionnel avec un conteur lxc ou docker. Pendant une fraction de seconde, il y a un message d’erreur (pas le temps de le lire) mais l’interface utilisateur s’ouvre sans pb dans la foulée.

Il y a un petit bug.
Ce paramètre:
image
n’est en réalité pas reporté dans /etc/ssowat/conf.json
image
et n’est donc pas appliqué…
Avec yunohost app setting komga protect_against_basic_auth_spoofing -v False et yunohost app ssowatconf
tout rentre dans l’ordre.
image
et tu peux accéder au tableau de bord.

Merci beaucoup, ça a l’air de marcher.

I have the same problem.

My French is very weak so I may have misunderstood.
Based on the solution mentioned above, I have entered
’ “protect_against_basic_auth_spoofing”: false,’ to /etc/ssowat/conf.json

 "komga.main": {
            "auth_header": false,
            "protect_against_basic_auth_spoofing": false,
            "public": true,
            "uris": [

Unfortunately the problem still persist.

In conf.json my domain is correct and the name of my YunoHost admin profile is alse stated as user. But I cannot use this as a user. I seems that only email addresses are accepted as user nam for Komga. Should not any email address work?

It should work with any email/password combination.
One important thing to note: even if an error message appears after the admin account creation, the credentials you entered are actually saved. Try logging in again using the same email and password you initially provided — it should work.
If not, a reinstall might be the easiest fix.

Ok, I will try. Thanks.
Can I see the username and password somewhere?

Uhh… Try reading the database /home/yunohost.app/komga/database.sqlite but I think that password should be encrypted.

Now I tried to reinstall it (again). It’s interesting, that when I first visit the login page I only have the oprion to ‘Create account’ (‘Sign in’ is greyed out). When I create an account, I get the error message ‘Invalid authentication: Request failed with status code 401’ but now the ‘Create account’ field is gone. Isn’t that weird? I suppose it should still be possible for new users to ‘Create account’?

I am not very used to look at files like database.sqlite but from my little experience, this looks strange:

VALUE              varchar NOT NULL,
    ALLOW_UNAUTHORIZED boolean NOT NULL default 0
)K�C^F^W_9^A^@indexsqlite_autoindex_CLIENT_SETTINGS_GLOBAL_1CLIENT_SETTINGS_GLO>
(

There ar sp many signs like the :" K�C^F^W_9^A^" part.

Is that normal?

I does not work

  • after many attempts :frowning:

Komga has its own database, independent of Yunohost. That is why it requires creating an admin user during the first login. This user then creates the others. To read the database run sqlite3+ database name, then .tables and SELECT * FROM users; (not sure if it’s users or user… )

Ok, so my username is there.
I still cannot ‘come in’, though.

Yes, it works…

~# sqlite3 /home/yunohost.app/komga/database.sqlite
sqlite> .tables
sqlite>  SELECT * FROM user;

=> can see username.

In your case, why not just reinstall?

I have reinstalled MANY times.

Okay, okay… :grinning_face_with_smiling_eyes:
Let’s try one last time and then I quit… :grin:

  • install Komga
  • create account : email: whateveryouwant@weyw.com / password: whateveryouwant
    => Error 401
  • CLI : yunohost app setting komga protect_against_basic_auth_spoofing -v False and yunohost app ssowatconf
  • refresh komga page
  • log in with whateveryouwant@weyw.com / password: whateveryouwant
  • login successful

Let’s try one last time and then I quit… :grin:

I really appreciate that you try to help me :folded_hands:

What is the correct way to do it?

What I did is to use nano to open komga/settings.yml and ssowat/conf.json

I did not see any need to make changes in komga/settings.yml, but added "protect_against_basic_auth_spoofing": false," in ssowat.conf.json

Is that correct or should I have done sometning else?

Hi,
You don’t need to edit these files with nano. Just run yunohost app setting komga protect_against_basic_auth_spoofing -v false then yunohost app ssowatconf. It will add this to ssowat/conf.json (and delete what you added in settings.yml).

Ok,
I connect to th eserver through ssh as the admin of the yunohost.
Should I run the commandsa as the yunohost admin or as root, or should I first run the ‘sudo yunohost app shell komga’ command and do it from there?

yes, as admin: sudo yunohost app setting komga protect_against_basic_auth_spoofing -v false and sudo yunohost app ssowatconf