; KohaRest driver configuration ; ; The KohaRest driver uses only Koha's REST APIs for all functionality. It does not ; need the ILS-DI API or database access. However, there are some prerequisites for ; Koha that must be completed on the Koha server first: ; ; 1. Plugins are enabled. See ; https://koha-community.org/manual/20.11/en/html/plugins.html ; 2. REST plugin for discovery interfaces ; (https://github.com/natlibfi/koha-plugin-rest-di) is installed and enabled in ; Koha. Verify by visiting /api/v1 on Koha server and check that there are routes ; beginning with /contrib/kohasuomi . ; 3. OAuth2 is enabled for the REST API in Koha (see below). ; 4. A user account with sufficient privileges is created, and an API ; key is added to the user (see below). [Catalog] ; The API address without any version such as v1 host = "http://koha-server/api" ; N.B. The KohaRest driver uses OAuth2 authentication with Koha. Please follow the ; steps below to configure OAuth2 in Koha and setup the credentials for a patron ; account. Patron's user name and password are not used here, as OAuth2 relies on a ; key/secret pair for authentication. ; ; Make sure the RestOAuth2ClientCredentials preference is enabled in Koha, and ; that the Koha server has the Net::OAuth2::AuthorizationServer cpan module ; installed (minimum version 0.16). ; See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20624 for more ; information. ; ; If an API request to Koha returns an error with HTTP status 401 (the error message ; may vary), Koha's Apache server may be removing the Authorization header from ; incoming requests. Add the following line to the virtual host configuration(s) in ; Koha's Apache server configuration to make it pass the header through to Koha: ; ; SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 ; ; You should create a Koha user for the API with at least the following privileges: ; - circulate_remaining_permissions ; - catalogue ; - borrowers ; - edit_borrowers ; - view_borrower_infos_from_any_libraries ; - reserveforothers ; - modify_holds_priority ; - place_holds ; - updatecharges ; - payout ; - remaining_permissions ; ; Add an API key to the user and copy the values for Client ID and Secret below. ; To add an API key in Koha, go to the patron screen and click More -> Manage API ; keys. On this screen you can generate a new ID/Secret pair for OAuth2 ; authentication. ; ; Koha API Client ID for OAuth2 authentication clientId = "" ; Koha API Client Secret for OAuth2 authentication clientSecret = "" ; Your Koha OPAC record display URL, if you want to provide direct links to your Koha ; OPAC. You can include a %%id%% placeholder to indicate where a URL-encoded bib ID ; should be inserted; if the placeholder is omitted, the ID will be appended on the ; end. Leave this commented out to omit OPAC links. ;opacURL = "http://koha-server/cgi-bin/koha/opac-detail.pl?biblionumber=%%id%%" ; If we trust our authentication source and know it to be the same as the one used by ; Koha then we can choose to not validate our patron's passwords (Useful if you are ; using SAML/Shibboleth for authentication for both VuFind and Koha) ; ; It is strongly recommended that you set allowUserLogin to false in the [Catalog] section ; of config.ini when setting this value to true. dontValidatePasswords = false ; This section controls hold behavior; note that you must also ensure that Holds are ; enabled in the [Catalog] section of config.ini in order to take advantage of these ; settings. Additional notes about some of these settings are available in the wiki: ; https://vufind.org/wiki/configuration:ils:holds [Holds] ; HMACKeys - A list of hold form element names that will be analyzed for consistency ; during hold form processing. Most users should not need to change this setting. HMACKeys = item_id:holdtype:level ; defaultRequiredDate - A colon-separated list used to set the default "not required ; after" date for holds in the format days:months:years ; e.g. 0:1:0 will set a "not required after" date of 1 month from the current date. ; Set to empty for no default. defaultRequiredDate = 0:0:2 ; extraHoldFields - A colon-separated list used to display extra visible fields in the ; place holds form. Supported values are "startDate", "requiredByDate", ; "requiredByDateOptional" and "pickUpLocation" extraHoldFields = requiredByDate:pickUpLocation ; A Pick Up Location Code used to pre-select the pick up location drop down list and ; provide a default option if others are not available. Must be one of the following: ; 1) empty string to indicate that the first location is default (default setting) ; 2) "user-selected" to indicate that the user always has to choose the location ; 3) a value within the Location IDs returned by getPickUpLocations() defaultPickUpLocation = "" ; By default the pick up location list is sorted alphabetically. This setting can be ; used to manually set the order by entering location IDs as a colon-separated list. ; You can also disable sorting by setting this to false. ;pickUpLocationOrder = 158:155 ; This setting can be used to exclude locations from the pickup location list ;excludePickupLocations = 1:6:10:15 ; Fields that can be updated for holds (unless the hold is already in transit or ; available for pickup). Supported values are "frozen", "frozenThrough" and ; "pickUpLocation" updateFields = frozen:frozenThrough:pickUpLocation ; Optional help texts that can be displayed on the hold form. Displayed as is; ; HTML tags can be used, and everything needs to be properly escaped. ;helpText[*] = "Default help text used if not overridden." ;helpText[en-gb] = "Help text for British English localization." ; Optional help texts that can be displayed on the hold update form. Displayed as is; ; HTML tags can be used, and everything needs to be properly escaped. ;updateHelpText[*] = "Hold update default help text used if not overridden." ;updateHelpText[en-gb] = "Hold update help text for British English localization." ; Whether to allow canceling of holds while in transit to pick up location. Default ; is false. ;allowCancelInTransit = false ; This section controls article request behavior. To enable, uncomment (at minimum) ; the HMACKeys and extraFields settings below. [StorageRetrievalRequests] ; Whether to allow article requests on checked out items. Default is false. ;allow_checked_out = true ; HMACKeys - A list of form element names that will be analyzed for consistency ; during form processing. Most users should not need to change this setting. HMACKeys = item_id:holdings_id:StorageRetrievalRequest ; extraFields - A colon-separated list used to display extra visible fields in the ; place request form. Supported values are "comments", "pickUpLocation", ; "item-issue" and "acceptTerms" extraFields = item-issue:acceptTerms:pickUpLocation ; Optional help texts that can be displayed on the request form. Displayed as is; ; HTML tags can be used, and everything needs to be properly escaped. ;helpText[*] = "Help text for all languages." ;helpText[en-gb] = "Help text for British English localization." ; This section allows modification of the default mappings from item status codes to ; VuFind item statuses [ItemStatusMappings] ;Item::Held = "Held" ; "Not For Loan" or "Lost" statuses can be mapped by appending the authorized value ; to the status key like this (first one is a negative authorized value, next ones ; are positive): ;Item::NotForLoan-1 = "Ordered" ;Item::NotForLoan4 = "At Bindery" ;Item::Lost4 = "Lost--Library Applied" ; Also "Not For Loan" item types can be mapped by appending the authorized value to ; the status key like this: ;ItemType::NotForLoan1 = "Reference Desk" ; Uncomment the following lines to enable password (PIN) change ;[changePassword] ; PIN change parameters. The default limits are taken from the interface documentation. ;minLength = 4 ;maxLength = 4 ; See the password_pattern/password_hint settings in the [Authentication] section ; of config.ini for notes on these settings. When set here, these will override the ; config.ini defaults when Voyager is used for authentication. ;pattern = "numeric" ;hint = "Your optional custom hint can go here." [TransactionHistory] ; By default the loan history is disabled. Uncomment the following line to enable it. ;enabled = true ; By default purging of all loan history is enabled. Uncomment the following line ; to disable it: ;purgeAll = false ; This section allows libraries to define custom renewal block messages for specific item types. ; The first string is the item type. In the below example, ILL. ; Then the [] should contain the Koha returned renewal block reason ; The second string after the equal sign is the renewal block message to display in VuFind - defined in the relevant language file in the ILSMessages directory. [ItemTypeRenewalBlockMappings] ; ILL[too_many] = "ILSMessages::ill_item_renewal_limit" ; ILL[too_soon] = "ILSMessages::ill_renewal_too_soon"