Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Satosa-Saml2Spid/Eudi - Readme Review for initial setup of the environment #95

Merged
merged 7 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ sudo yum install -y python3-wheel python3-devel

###### Prepare environment

Within the directory `/{your path}/Satosa-Saml2Spid` execute the following commands:

```
pip install --upgrade pip
pip install virtualenv
Expand All @@ -39,7 +41,7 @@ pip install -r requirements.txt

## Configure the Proxy

- Create certificates for SPID see [psmiraglia](https://github.com/italia/spid-compliant-certificates).
- Create certificates for SPID, using [spid-compliant-certificates](https://github.com/italia/spid-compliant-certificates) or [spid-compliant-certificates-python](https://github.com/italia/spid-compliant-certificates-python)
- Copy `repository/example/*` contents (`cp -R repository/example/* .`) and **edit the files below**

- `proxy_conf.yaml`
Expand Down
54 changes: 34 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ with the **Italian Digital Identity Systems**.

## Table of Contents

1. [Goal](#goal)
2. [Demo components](#demo-components)
3. [Docker](#docker)
6. [Setup](README-Setup.md)
8. [For Developers](#for-developers)
9. [Author](#authors)
10. [Credits](#credits)
1. [Glossary](#Glossary)
2. [General features](#general-features)
3. [Introduction](#introduction)
4. [Demo components](#demo-components)
5. [How to start the environment](#how-to-start-the-environment)
6. [For Developers](#for-developers)
7. [Author](#authors)
8. [Credits](#credits)


## Glossary
Expand Down Expand Up @@ -75,34 +76,47 @@ To get redirection to these pages, or redirection to third-party services, it is
- file: `example/proxy_conf.yml`, example value: `UNKNOW_ERROR_REDIRECT_PAGE: "https://static-contents.example.org/error_page.html"`
- file: `example/plugins/{backends,frontends}/$filename`, example value: `disco_srv: "https://static-contents.example.org/static/disco.html"`

<hr>

## Docker
## How to start the environment

<img src="gallery/docker-design.svg" width="512">
The average time to set up the environment is about 1 hour. This time may vary depending on the machine's resources and the type of network connection.

The official Satosa-Saml2SPID docker image is available at
[italia/satosa-saml2spid](https://ghcr.io/italia/satosa-saml2spid).
> Make sure that in your environment is correcly installed:
> - a version of Python 3.10 or higher
> - Git
> - Docker

Below some quick commands:
#### STEP 1 - Setup
please review the following documentation in order to install, configure and run Satosa-Saml2spid
[README-SETUP.md](README-Setup.md)

- Install it, execute the following command: `sudo docker pull ghcr.io/italia/satosa-saml2spid:latest`.
- Build locally the image, execute the following command: `docker build -t satosa-saml2spid .`.
- Inspect the image content: `docker run -it -v $(pwd)/example:/satosa_proxy --entrypoint sh satosa-saml2spid`.
#### STEP 2 - Docker Compose

please review the following documentation [Docker-compose](Docker-compose/README.md) in order to create the volumes:
- satosa-saml2spid_mongodata
- satosa-saml2spid_nginx_certs

### Docker compose

Satosa-Saml2Spid image is built with production ready logic.
The docker compose may use the [enviroment variables](#configuration-by-environment-variables)
The docker compose may use the [enviroment variables](README-Setup.md#configuration-by-environment-variables)
to configure Satosa-Saml2Spid.

See [Docker-compose](Docker-compose) for details.
<img src="gallery/docker-design.svg" width="512">

The official Satosa-Saml2SPID docker image is available at
[italia/satosa-saml2spid](https://ghcr.io/italia/satosa-saml2spid).
To install it, you can execute the following command: `sudo docker pull ghcr.io/italia/satosa-saml2spid:latest`.

Otherwise you can build the image executing the following command: `docker build -t satosa-saml2spid .`.

Then you can even inspect the image content, by running the following command: `docker run -it -v $(pwd)/example:/satosa_proxy --entrypoint sh satosa-saml2spid`.

## Setup
#### STEP 3 - Install and Run Djangosaml2 demo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### STEP 3 - Install and Run Djangosaml2 demo
#### STEP 3 - Install and Run a Demo SAML2 Service Provider


See [README-SETUP.md](README-Setup.md).
please review the following documentation [Djangosaml2](example_sp/djangosaml2_sp/README.md)

<hr>

## For Developers

Expand Down
31 changes: 31 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Pre-requirements

Make sure that the following Docker containers are up and running
<img src="../gallery/docker_container.png">



> **NOTE**
> - use the following command to check if everythings is correctly running ``docker ps -a``
> - use the following command to start a stopped container ``docker start <NAME>``

<hr>

if everything is okay, you will be able to access the login Saml2 service provider page


<img src="../gallery/disco_page.png">


### To log in, follow the steps described in the image below:

![result](../gallery/screen.gif)

> #### NOTE:
>
> - Use "Entra con SPID" and select "Spid_Test" Method
> - Use the following credential -> user: validator | psw: validator
> - Use the following link to Load Metadata `https://satosa-nginx/spidSaml2/metadata`
>


24 changes: 23 additions & 1 deletion example_sp/djangosaml2_sp/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# How to run the Demo Django template


Within the directory `/{your path}/Satosa-Saml2Spid/example_sp` execute the following commands

### djangosaml2-sp (SP server)
````
sudo apt install xmlsec1 python3-dev python3-pip libssl-dev
Expand All @@ -8,7 +13,7 @@ source env/bin/activate

cd djangosaml2_sp
# download idp metadata to sp, not needed if remote options is enabled
wget https://localhost:10000/Saml2IDP/metadata/ -O saml2_sp/saml2_config/satosa-saml2spid.xml --no-check-certificate
wget https://localhost/Saml2IDP/metadata/ -O saml2_sp/saml2_config/satosa-saml2spid.xml --no-check-certificate

# install prerequisite
pip install -r requirements.txt
Expand All @@ -20,6 +25,23 @@ python manage.py migrate
./manage.py runserver 0.0.0.0:8000
````

At the end of the execution, the server will be started at the following link: http://0.0.0.0:8000
and you will be able to view the project's demo page (see below)



<img src="../../gallery/djangosaml2_sp.png">




Now click on "Accedi all'area personale" (at the top right of the page header).
You will be redirect to the Saml2 Service Provider page [Service Provider page](../../example/README.md)





### Add SP metadata to Satosa server
```
# put sp metadata to satosa
Expand Down
Binary file added gallery/disco_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/djangosaml2_sp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/docker_container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading