Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digirati-co-uk/iiif-auth-client
IIIF Auth 1.0 Client demo
https://github.com/digirati-co-uk/iiif-auth-client
iiif
Last synced: 3 months ago
JSON representation
IIIF Auth 1.0 Client demo
- Host: GitHub
- URL: https://github.com/digirati-co-uk/iiif-auth-client
- Owner: digirati-co-uk
- License: mit
- Created: 2017-04-04T08:13:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-23T13:12:34.000Z (over 2 years ago)
- Last Synced: 2024-08-01T12:33:22.980Z (6 months ago)
- Topics: iiif
- Language: JavaScript
- Homepage: https://digirati-co-uk.github.io/iiif-auth-client/?sources=https://iiif-auth1.herokuapp.com/index.json
- Size: 350 KB
- Stars: 8
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - digirati-co-uk/iiif-auth-client - IIIF Auth 1.0 Client demo (others)
README
# iiif-auth-client
This is a client implementation of the [IIIF Authentication specification](http://iiif.io/api/auth/1.0/). It can be used to test individual auth-enabled IIIF Image services:
[https://digirati-co-uk.github.io/iiif-auth-client/?image=https://iiifauth.digtest.co.uk/img/01_Icarus_Breughel.jpg/info.json](https://digirati-co-uk.github.io/iiif-auth-client/?image=https://iiifauth.digtest.co.uk/img/01_Icarus_Breughel.jpg/info.json)
...or it can be given a list of images that will populate a drop-down:
[https://digirati-co-uk.github.io/iiif-auth-client/?sources=https://iiifauth.digtest.co.uk/index.json](https://digirati-co-uk.github.io/iiif-auth-client/?sources=https://iiifauth.digtest.co.uk/index.json)
> The accompanying server implementation (see below) expects username=username, password=password whenever it presents a login screen.
`iiif-auth-client` is written in ES6 with no dependencies and no transpiling. It is therefore not intended for production use unaltered, but as an example implementation. As ES6 it is easier to understand how the IIIF Auth specification orchestrates the user through one or more interaction patterns, because asynchronous user behaviour and HTTP requests to services can be encapsulated in `async` functions.
For example, the control flow in the [Workflow from the Browser Client Perspective](http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective) diagram involves opening windows, waiting for them to close, and making web requests for services. This flow becomes readable as ES6.
![user interaction](https://raw.githubusercontent.com/digirati-co-uk/iiif-auth-client/master/flow_part.PNG "user interaction")
```javascript
// ...
let contentProviderWindow = await getContentProviderWindowFromModal(serviceToTry);
if(contentProviderWindow){
await userInteractionWithContentProvider(contentProviderWindow);
let success = await attemptImageWithToken(serviceToTry, requestedId);
// ...
```The example server implementation:
* Running example: [https://iiifauth.digtest.co.uk/](https://iiifauth.digtest.co.uk/)
* Source: [iiif-auth-server](https://github.com/digirati-co-uk/iiif-auth-server)## TODO
`iiif-auth-client` does not yet have any optimisations that a IIIF viewer would typically implement. Client applications are encouraged to cache and reuse tokens to prevent unnecessary user interactions (such as showing dialogue boxes if the user is already authenticated). Examples of these optimisations will be added later.
The application does not yet handle any Presentation API resources, only individual Image API services, one at a time. A client application that loads a manifest should produce a more seamless experience when navigating from image to image.