/callbacks/patron Callback endpoint for Patron SSO login and registration.
Callback endpoint for Patron SSO login and registration.
If the authentication is successful, the query parameters 'code' and 'state' are required. Otherwise, the query parameter 'error' is required.
Eksempel på kall
cURL
curl -X GET "$PLAS_BASE_URL/callbacks/patron?version=0.6.7" \
-H 'Accept: application/json' JavaScript
const response = await fetch(`${process.env.PLAS_BASE_URL}/callbacks/patron?version=0.6.7`, {
method: "GET",
headers: {
"Accept": "application/json",
},
}); Python
import os
import requests
response = requests.get(
f"{os.environ['PLAS_BASE_URL']}/callbacks/patron",
params={
"version": "0.6.7",
},
headers={
"Accept": "application/json",
},
)
response.raise_for_status() PLAS_BASE_URL providerens adresse.
Parametere
- code
- query · stringEksempel: SplxlOBeZQQYbYS6WxSbIA
The code obtained from the SSO patron login.
- state
- query · stringEksempel: af0ifjsldkj
The state sent to the SSO patron login.
- app_redirect_url
- query · string (uri)Eksempel: https://app.nordby.bibliotek.example/callback
The app redirect url sent to the SSO patron login.
- can_be_registered
- query · booleanEksempel: true
Indicates whether the patron can be registered.
- consent
- query · array of stringEksempel: bG9hbl9oaXN0b3J5:MjAyNS0wMQ
Each value is formatted as
type:versionwhere bothtypeandversionare URL Base64 encoded (the colon separator is not encoded). Multipleconsentparameters may be present. Only returned whencan_be_registeredistrue.All consents returned to this SSO callback must be included when registering this patron through the POST /patron/registration/identifier endpoint. If a new patron registration flow is started from this callback, any consent parameters from previous callbacks should be ignored.
- error
- query · stringEksempel: sso_unauthorized_client
A machine-readable error code indicating why the operation failed. Its presence signifies a failure and should be handled accordingly by the Vendor Backend.
Error codes:
sso_unauthorized_client— The client is not authorized to use the SSO service.sso_invalid_credentials— The credentials provided to the SSO service are invalid.sso_access_denied— The patron's account has been blocked or is not eligible for use with this service (e.g. account locked).sso_request_expired— The SSO authentication flow expired before the patron completed it.sso_login_cancelled— The patron actively cancelled the authentication process.sso_consent_denied— The patron was authenticated but refused to give the required consent.sso_session_expired— The patron's SSO session ended or the patron was logged out during the flow.sso_unknown_error— An unspecified error occurred during the SSO authentication process.provider_patron_not_found— The patron could not be found in the provider's system.provider_service_unavailable— The provider was unable to contact the identity provider (e.g. maintenance or connectivity issues).provider_unknown_error— An unspecified error occurred in the provider's system.
For error codes such as
sso_access_deniedandsso_consent_denied, the vendor should advise the patron to contact their local library. Other error codes may also warrant this guidance, at the vendor's discretion. - error_description
- query · stringEksempel: The patron cancelled the login.
A human-readable text providing additional details about the error. This is intended for logging and debugging purposes.
Svar
302 Redirect to the application that initialized the SSO patron login, with the code and state as query parameters.
Ikke noe innhold i svaret.