Code Monkey home page Code Monkey logo

iiif-auth-server's Introduction

iiif-auth-server

A demo server implementation of all apsects of the IIIF Authentication specification. It shows:

  • The Login interaction pattern
  • The Clickthrough interaction pattern
  • The Kiosk interaction pattern
  • The External interaction pattern
  • "All or nothing" and degraded image access
  • Token and Cookie services

This is a work in progress, please raise issues! It is intended to assist client development by providing a live implementation to test against.

It uses https://github.com/rogerhoward/iiify as base simple server. It's a Flask app that uses Pillow via iiif2 to generate image tiles. iiif-auth-server adds an IIIF auth implementation to demonstrate the different interaction patterns, the cookie services, and the token service.

The latest version of this application should be running at https://iiifauth.digtest.co.uk/.

There is an accompanying JavaScript client application to run against the server demo at https://github.com/digirati-co-uk/iiif-auth-client.

This is not a production application! A typical institutional implementation would likely protect many thousands of images with the same cookie and token services, whereas this demo makes you authenticate for most of the sample images separately. It also gives access to everyone's session for diagnostic purposes, has one hardcoded username and password for Login pattern cookie services, and so on. However, it should exercise every part of the specification.

Usage

  1. Clone this repo
  2. (optional) In the iiif-auth-server directory, set up a virtualenv:
python3 -m venv venv
  1. To install for development:
pip install --editable .
  1. to run for development:
export FLASK_APP=iiifauth
export FLASK_DEBUG=true
flask run

or

. runflask.sh
  1. Token information is stored in a sqllite3 db, which needs to be initialised:
flask initdb

Problems - you will need to install jpeg support for pillow if you don't already have it, e.g., on Ubuntu

# install libjpeg-dev with apt
sudo apt-get install libjpeg-dev
# if you're on Ubuntu 14.04, also install this
sudo apt-get install libjpeg8-dev

# reinstall pillow
pip install --no-cache-dir -I pillow

(from http://stackoverflow.com/questions/8915296)

iiif-auth-server's People

Contributors

tomcrane avatar fractos avatar mattmcgrattan avatar stephenwf avatar dependabot[bot] avatar

Stargazers

Matthias Hohner avatar Fei Lidén avatar Alberto Colón Viera avatar Jain Wun Su avatar Abbas Hussain avatar Ben Companjen avatar Alberto Colón Viera avatar jon ⚝ avatar

Watchers

James Cloos avatar  avatar Fei Lidén avatar

iiif-auth-server's Issues

IP restriction example

Demonstrate how an IP restriction would work (use a fake external service). Maybe instead of IP use something to do with time, so people can see it not working, then working, then not working...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.