Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 10-25-2023, 03:04 AM   #1
duydl
Junior Member
duydl began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2023
Device: Kindle Paperwhite
Fetch from content server API when require login is on

I want to ask about the authenticate header format for fetching from the ajax api of calibre content server or if it is available.
duydl is offline   Reply With Quote
Old 10-25-2023, 03:05 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,981
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
HTTP Basic or HTTP Digest
kovidgoyal is offline   Reply With Quote
Old 10-25-2023, 03:55 AM   #3
duydl
Junior Member
duydl began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2023
Device: Kindle Paperwhite
Before I posted the thread I had tried HTTP basic but it did not work.

const base64Credentials = btoa(username + ':' + password);
fetch(fetch_link, {
method: 'GET',
headers: {
'Authorization': 'Basic ' + base64Credentials,
'Content-Type': 'application/json',
},
})
.then(response =>

I will test it again then.
Thank you for the reply.
duydl is offline   Reply With Quote
Old 10-25-2023, 05:29 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,981
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The entire content server, including its API uses HTTP Auth in either basic or digest mode. There is no other form of authentication.

You tried basic the server might be using digest (there are options in the server preferences to control this)

See for example:

Code:
curl --digest --user username:password http://localhost:8080/ajax/library-info                                                      

{"library_map": {"test_library": "test library", "library": "library", "erolib": "erolib", "demo_library": "demo library", "largelib": "largelib"}, "default_library": "test_library"}
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Content Server Json API mathewparet Development 1 01-27-2023 09:15 AM
Login failure with userdb with content server rodvp Server 7 11-27-2020 12:48 AM
Content Server Login method SASSBS Server 1 07-23-2018 02:55 AM
calibre Content Server Interfacing API alexyeo Development 2 10-31-2011 11:18 PM
Calibre Content Server - login The QCC Calibre 2 03-14-2011 10:13 PM


All times are GMT -4. The time now is 02:57 PM.


MobileRead.com is a privately owned, operated and funded community.