geometer / FBReaderJ

Official FBReaderJ project repository
http://www.fbreader.org/FBReaderJ/
1.83k stars 802 forks source link

OPDS book catalogue login support #160

Open HaakonME opened 10 years ago

HaakonME commented 10 years ago

Is it possible or is it planned to support logging in to an OPDS book catalogue?

Reference:

http://opds-spec.org/specs/opds-catalog-1-1-20110627/#Securing_OPDS_Catalogs

"13. Securing OPDS Catalogs

OPDS Catalogs are delivered over HTTP. Authentication requirements for HTTP are covered in Section 11 of [RFC2616].

The type of authentication required for any OPDS Catalog is a decision to be made by the OPDS Catalog provider. OPDS Catalog clients are likely to face authentication schemes that vary across OPDS Catalogs. At a minimum, client and server implementations MUST be capable of being configured to use HTTP Basic Authentication [RFC2617] in conjunction with a connection made with TLS 1.0 [RFC2246] or a subsequent standards-track version of TLS supporting the conventions for using HTTP over TLS described in [RFC2818]. It is RECOMMENDED that OPDS Catalog clients be implemented in such a way that new authentication schemes can be deployed.

Because this protocol uses HTTP response status codes as the primary means of reporting the result of a request, OPDS Catalog providers are advised to respond to unauthorized or unauthenticated requests using an appropriate 4xx HTTP response code (e.g., 401 "Unauthorized" or 403 "Forbidden") in accordance with [RFC2617]."

geometer commented 10 years ago

Hi Haakon,

AFAIK, it is supported. At least it works for feedbooks catalog. Ok, I did not tested it last few months but I'm sure it was working some times ago.

Do you have an example of catalog with authorisation that does not work in FBReader?

HaakonME commented 10 years ago

Yes, I have an example, but the problem might be with the catalogue itself, and not FBReader.

I have setup the latest Mediawiki with Luciwik 0.4 from http://lucidor.org/ , an extension which adds a searchable OPDS catalogue for wiki articles and export of articles into ebooks in EPUB format.

This works well for http://far.no/ , where the articles are openly available. Just add

http://www.far.no/index.php?title=Spesial:Luciwik

as the catalogue URL in FBReader.

However, a friend of mine is an author, and I have created a private wiki for him and his latest book, which requires logging in to see any page beyond the opening page. He can then log in, change his book, and immediately download the corrected EPUB ebook.

The book catalogue is a special page, and so is also unavailable unless you log in to the private Mediawiki, which is what is wanted here. He can provide read-only accounts to his readers, either gratis or for a fee, for instance a three year "author subscription account". These users can already log in on the web page, hit "Download as ebook", and get the latest version of their chosen book. However, it would be much better if they could add the book catalogue URL to their preferred reader, like FBReader or Lucifox, give their credentials to login and access the book catalogue and download the latest books from within their preferred reader.

What happens now is that FBReader complains, and says the URL is not OPDS catalogue. The same is true for Lucifox, but if the user is logged into the wiki, then the browser has access and the book opens in Lucifox.

geometer commented 10 years ago

Very interesting, will try to investigate this evening.

On 16 Oct 2013, at 14:13, Haakon Meland Eriksen wrote:

Yes, I have an example, but the problem might be with the catalogue itself, and not FBReader.

I have setup the latest Mediawiki with Luciwik 0.4 from http://lucidor.org/ , an extension which adds a searchable OPDS catalogue for wiki articles and export of articles into ebooks in EPUB format.

This works well for http://far.no/ , where the articles are openly available. Just add

http://www.far.no/index.php?title=Spesial:Luciwik

as the catalogue URL in FBReader.

However, a friend of mine is an author, and I have created a private wiki for him and his latest book, which requires logging in to see any page beyond the opening page. He can then log in, change his book, and immediately download the corrected EPUB ebook.

The book catalogue is a special page, and so is also unavailable unless you log in to the private Mediawiki, which is what is wanted here. He can provide read-only accounts to his readers, either gratis or for a fee, for instance a three year "author subscription account". These users can already log in on the web page, hit "Download as ebook", and get the latest version of their chosen book. However, it would be much better if they could add the book catalogue URL to their preferred reader, like FBReader or Lucifox, give their credentials to login and access the book catalogue and download the latest books from within their preferred reader.

What happens now is that FBReader complains, and says the URL is not OPDS catalogue. The same is true for Lucifox, but if the user is logged into the wiki, then the browser has access and the book opens in Lucifox.

— Reply to this email directly or view it on GitHub.

HaakonME commented 10 years ago

Great!

geometer commented 10 years ago

Heh, now I read your message carefully. :) Is it possible to send me (in a private message) a link to the private catalog. As for far.no it works well as far as I see.

HaakonME commented 10 years ago

A private message has been sent to your e-mail address. :-)