Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed OPDS basic auth for android Coolreader #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ignis32
Copy link

@ignis32 ignis32 commented Nov 24, 2021

The following issue from this forum thread is still actual fo me 4 years after:
http://www.sopds.ru/index.php/forum/razdel-predlozhenij/421-ne-avtorizuet-v-soopds-iz-coolreader

I've bumped into this issue using latest sopds from git and Coolreader from the google play market.

Looks like issue is that Coolreader does not send "Basic" keyword before actuatal base64 credentials.
I've compared data that browser sends and what Coolreader sends - and they end up in authentication = request.META differently.
In browser it is like authentication = "Basic AaaAaAaaBase64EncodedCreds"
With coolreader it is just authentication = "AaaAaAaaBase64EncodedCreds".

This causes 500 error with (auth_meth, auth_data) = authentication.split(' ',1) line in middlware.py not able to split the string.

Fix that I suggest enabled auth Coolreader, and it does not break regular auth for me.

Вот эта проблема 4хлетней давности с форума все еще похоже актуальна:
http://www.sopds.ru/index.php/forum/razdel-predlozhenij/421-ne-avtorizuet-v-soopds-iz-coolreader

Я воспроизвел ее с обычным Coolreaderом из гугломаркета и sopds из гита, на совершенно чистой новой машине. Суть в том, что Coolreader шлет только base64 строку с логином и паролем, а слово Basic не шлет. Фикс который я предлагаю - порешал для меня это проблему.

@ignis32
Copy link
Author

ignis32 commented Nov 25, 2021

Looks like CoolReader auth is fixed by Peter Voronov in #75 already, and also it fixes telegram bot that did not work for me from the original sources
Probably it is better to use his fix.

Похоже аутентификацию уже починили в #75 и сделали это лучше, заодно починив телеграм бота. Видимо лучше использовать его пулл реквест.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant