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 3 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
6 changes: 5 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

move to the directory `/{your path}/Satosa-Saml2Spid` and execute the following commands
davidelongo-ey marked this conversation as resolved.
Show resolved Hide resolved

```
pip install --upgrade pip
pip install virtualenv
Expand All @@ -39,7 +41,9 @@ 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 see [psmiraglia](https://github.com/italia/spid-compliant-certificates)
davidelongo-ey marked this conversation as resolved.
Show resolved Hide resolved
(For more details please see also the [Python native solution](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
68 changes: 51 additions & 17 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,8 +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>

## How to start the environment



davidelongo-ey marked this conversation as resolved.
Show resolved Hide resolved
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.





> Make sure that in your environment is correcly installed:
> - a version of Python 3.9 or higher
davidelongo-ey marked this conversation as resolved.
Show resolved Hide resolved
> - Git
> - Docker




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



#### 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



Satosa-Saml2Spid image is built with production ready logic.
The docker compose may use the [enviroment variables](#configuration-by-environment-variables)
Copy link
Member

Choose a reason for hiding this comment

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

Do you have tested the docker compose ENV variables?
They doesn't seem to work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you mean the "Anchor" doesn't work?

Copy link
Member

Choose a reason for hiding this comment

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

no, the Docker Compose ENVIRONMENT Variables

to configure Satosa-Saml2Spid.



## Docker

<img src="gallery/docker-design.svg" width="512">

Expand All @@ -90,19 +130,13 @@ Below some quick commands:
- Inspect the image content: `docker run -it -v $(pwd)/example:/satosa_proxy --entrypoint sh satosa-saml2spid`.


### Docker compose

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

See [Docker-compose](Docker-compose) for details.

#### STEP 3 - Install and Run Djangosaml2

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

See [README-SETUP.md](README-Setup.md).

<hr>

## For Developers

Expand Down
47 changes: 46 additions & 1 deletion example_sp/djangosaml2_sp/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### Pre-requirements

Before starting, 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>``



if everithings is ok, go to the path `/{your path}/Satosa-Saml2Spid/example_sp` and execute the following commands
Copy link
Member

Choose a reason for hiding this comment

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

everything

Copy link
Member

Choose a reason for hiding this comment

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

this is only for the DEMO

it doesn't bring any value for a production environment

please distinguish a general setup for a demo setup

Copy link
Member

Choose a reason for hiding this comment

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

this should be moved in the section above, related to the DEMO SAML2 SP



### djangosaml2-sp (SP server)
````
sudo apt install xmlsec1 python3-dev python3-pip libssl-dev
Expand All @@ -8,7 +24,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 +36,35 @@ 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 you will be able to make your first login, follow these simple steps:

![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`
> - Have fun!!
>





### Add SP metadata to Satosa server
```
# put sp metadata to satosa
Expand Down
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