api
api copied to clipboard
Authentication API and internationalization
While implementing the Authentication API, I stumbled on two issues with internationalized messages:
-
Multi-lingual/Multi-valued labels/headers/descriptions Currently the specification does not explicitely mention that these fields can be multi-lingual and multi-valued (as specified in 4.3. Language of Property Values in the Presentation API). @tomcrane assured me on the Slack that this is the case and that it should probably be spelled out in the specification.
-
Multi-lingual Access Token Error Condition descriptions Since these error objects are not JSON-LD, the above pattern does not work here. However, I think that having the ability to pass error descriptions in multiple languages is highly desirable, since these are mostly very environment-specific and can in many cases not be adequately handled by generic messages in IIIF client applications like Mirador (e.g. by switching on the error type).
Seems like we would address these as a matter of course in Auth 2.0 (whatever the outcome of #1959).
OK to have a JSON-LD language map in the token?
Discussed on Auth call
We don't see a problem with having a language map in the token. Or the token being a JSON-LD 1.1 resource.
But turning this around - should we instead drop description of the error completely? On the grounds that it's rare for a client to echo a server's error message as-is?
Counterargument - you are doing this right now; you have a working implementation that would use this.
This issues are addressed in draft form in https://github.com/IIIF/api/pull/2115
Commit: https://github.com/IIIF/api/pull/2115/commits/23f416e1b994b0b4746d5280e51eca0608c214e5
This makes the token error message a JSON-LD resource, with a type. The description property takes a language map.
This PR is a first pass at editorial issues and may be superseded by further changes to the implementation of the spec.
Resolved. The IIIF Authorization Flow 2.0.0 specification was published 2023-06-02: https://iiif.io/api/search/2.0/ . It now use language maps throughout, following the pattern of Presentation API 3.0