Skip to content

swissbib/pura-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pura User Management

Small Back-End application to manage private users from libraries who access online resources with their SWITCH edu-id.

Information about the Pura Project

For more information, feel free to contact us at [email protected].

General Info

Url :

Repositories :

Public documentation : http://www.swissbib.org/wiki/index.php?title=Private_User_Remote_Access_(Pura)

SWITCH API Documentation

Pura Databases

Pura-Back-End uses two mysql databases :

  • the main one is pura-db
  • the second one is puralogin which takes care of username and passwords for the authentication on pura-back-end

You can see the schemas in the sql folder of this repository.

Installation

Here are the instructions to install the pura back-end. They have been tested on Ubuntu 18.04.

Clone repo

git clone [email protected]:swissbib/pura-backend.git

Create the 2 Databases based on the schemas in the sql directory.

Adapt the configuration to use the correct databases :

cd config/autoload
cp development.local.php.dist development.local.php

In development.local.php, update :

  • databases info (multiple places)
  • credentials for the SWITCH API

Install dependencies

composer install

Run with php development server

php -S 0.0.0.0:8080 -t public/ public/index.php 

And go to http://localhost:8080

Create user / password for a library

To enable Pura for a new library (let's say it has library code A999) :

Add a user for pura-back-end :

Use PHP interactive mode :

php -a

To encrypt the 'new_password_to_encrypt'

> echo password_hash('new_password_to_encrypt', PASSWORD_BCRYPT);
> $21ruoigdyfhngfkjjThisIsTheEncryptedPassword

In the database

sudo mysql
use puralogin;
INSERT INTO `users` VALUES ('puraA999','$21ruoigdyfhngfkjjThisIsTheEncryptedPassword','A999');