10-25-2023, 03:04 AM | #1 |
Junior Member
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.
|
10-25-2023, 03:05 AM | #2 |
creator of calibre
Posts: 44,422
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
HTTP Basic or HTTP Digest
|
10-25-2023, 03:55 AM | #3 |
Junior Member
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. |
10-25-2023, 05:29 AM | #4 |
creator of calibre
Posts: 44,422
Karma: 24044628
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"} |
|
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 |