Page History
Info | ||
---|---|---|
| ||
In Finnish |
...
: Finnan kirjautumisrajapinta |
History
20.3.2017 Initial version
Table of Contents |
---|
General
Finna includes an API that can be used to determine whether the login credentials given by a user are correct. The API does not return patron information, only a success code. It . Successful authentication does not require the user to have an account in Finna, only in the target library system.
N.B. The authentication API is only available on agreement.
Character set is always UTF-8 (composed).
Please note that this API is very limited in functionality. Finna also supports OpenID Connect that offers more robust functionality and access to user attributes.
Functions
getLoginTargets
https://api.finna.fi/api/v1/auth/getLoginTargets?<parametrit>
Returns a list of available login targets (libraries), where a login request can be made. The response also includes information whether a secondary login field (typically user's last name in addition to library card number and PIN code) is required.
Parameter | Type | Descripion | Allowed Values |
---|---|---|---|
prettyPrint | Number | Whether the JSON is pretty-printed with line feeds | 0 (default), 1 |
lng | String | Language to use |
|
Example request:
https://api.finna.fi/api/v1/auth/getLoginTargets?prettyPrint=1&lng=en-gb
Example response:
Code Block | ||
---|---|---|
| ||
{ "targets": [ { "id": "moominvalley", "name": "Moominvalley library", }, { "id": "testi", "name": "Test library", "secondary_login_field_label": "Last Name" } ] } |
libraryCardLogin
Returns whether the login was successful and any errors encountered. The parameters must be sent with a POST request (application/x-www-form-urlencoded; charset=utf-8) .
Parameter | Type | Description | Allowed Values | |
---|---|---|---|---|
prettyPrint | Number | Whether the JSON is pretty-printed with line feeds | 0 (default), 1 | |
lng | String | Language to use |
| |
target | String | Login target, i.e. library | Any id returned by getLoginTargets request | |
username | String | User name (library card number) | ||
password | String | Password (PIN code) | ||
secondary | String | Secondary identification field if getLoginTargets returned a secondary_login_field_label |
Example request (here as a GET request, use a POST request):
...
Code Block | ||
---|---|---|
| ||
{"status":"ERROR","statusMessage":"Backend unavailable"} |
History
20.3.2017 Initial version