Bug 29995

Summary: Rest API Authentication
Product: Koha Reporter: Lokesh Chaudhary <lokeshchaudhary>
Component: REST APIAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact:
Severity: enhancement    
Priority: P5 - low CC: tomascohen
Version: 20.11   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: this problem comes under restful api ever the enable the basic auth and o2aurh from staff interface.

Description Lokesh Chaudhary 2022-02-01 13:52:25 UTC
Created attachment 130042 [details]
this problem comes under restful api ever the enable the basic auth and o2aurh from staff interface.

http://localhost:8080/api/v1/patrons

when we hit this url after login in staff interface we get the proper result 

Response : 

[{"address":null,"address2":null,"altaddress_address":null,"altaddress_address2":null,"altaddress_city":null,"altaddress_country":null,"altaddress_email":null,"altaddress_notes":null,"altaddress_phone":null,"altaddress_postal_code":null,"altaddress_state":null,"altaddress_street_number":null,"altaddress_street_type":null,"altcontact_address":null,"altcontact_address2":null,"altcontact_city":null,"altcontact_country":null,"altcontact_firstname":null,"altcontact_phone":null,"altcontact_postal_code":null,"altcontact_state":null,"altcontact_surname":null,"anonymized":false,"autorenew_checkouts":true,"cardnumber":"1","category_id":"S","check_previous_checkout":"inherit","city":null,"country":null,"date_enrolled":null,"date_of_birth":null,"date_renewed":null,"email":null,"expiry_date":"2099-12-31","fax":null,"firstname":"Koha","gender":null,"incorrect_address":false,"initials":"","lang":"default","last_seen":null,"library_id":"MPL","login_attempts":0,"mobile":null,"opac_notes":null,"other_name":null,"overdrive_auth_token":null,"patron_card_lost":false,"patron_id":1,"phone":null,"postal_code":null,"privacy":1,"privacy_guarantor_checkouts":0,"privacy_guarantor_fines":false,"relationship_type":null,"restricted":false,"secondary_email":null,"secondary_phone":null,"sms_number":null,"sms_provider_id":null,"staff_notes":null,"state":null,"statistics_1":null,"statistics_2":null,"street_number":null,"street_type":null,"surname":"Admin","title":null,"updated_on":"2021-11-13T21:03:07+05:30","userid":null},{"address":"3438 Library .....}]


if we hit the below url like this : 

http://localhost:8080/api/v1/patrons

with api keys and seceret on postman we get the resposnse :

{
    "error": "Authentication failure."
}

Please try to provide a solution for this problem.
Comment 1 Katrin Fischer 2022-02-01 22:02:47 UTC
Hi Lokesh, this is likely to be a configuration issue or similar, please consider asking on the mailing list or on IRC where you will reach many more users. Bugzilla should only be used for filing bugs or enhancement requests.