swissbib / pura-backend

PURA-Backend for Libraries
GNU General Public License v3.0
1 stars 0 forks source link

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 swissbib-ub@unibas.ch.

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 :

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 git@github.com: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 :

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');