|
| 1 | +# OneLogin's SAML Python Toolkit (compatible with Python3) |
| 2 | + |
| 3 | +Installation |
| 4 | +------------ |
| 5 | + |
| 6 | +### Dependencies ### |
| 7 | + |
| 8 | + * python 3.6 |
| 9 | + * apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl |
| 10 | + * pip install xmlsec |
| 11 | + * pip install isodate |
| 12 | + * pip install defusedxml |
| 13 | + * pip install python3-saml |
| 14 | + * pip install tornado |
| 15 | + |
| 16 | + |
| 17 | +***Virtualenv*** |
| 18 | + |
| 19 | +The use of virtualenv/virtualenvwrapper is highly recommended. |
| 20 | + |
| 21 | +### Create certificates ### |
| 22 | + |
| 23 | +in saml/cert run : |
| 24 | + * openssl req -new -x509 -days 3652 -nodes -out sp.crt -keyout sp.key |
| 25 | + * openssl req -new -x509 -days 3652 -nodes -out metadata.crt -keyout metadata.key |
| 26 | + |
| 27 | +### Useful extesion for SAML messages ### |
| 28 | +* [SAML Chrome Panel 1.8.9](https://chrome.google.com/webstore/detail/saml-chrome-panel/paijfdbeoenhembfhkhllainmocckace/related) |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +# Test with keycloack idp |
| 33 | + |
| 34 | +Installation |
| 35 | +------------ |
| 36 | + |
| 37 | +### Install Docker ### |
| 38 | +* sudo apt-get remove docker docker-engine docker.io containerd runc |
| 39 | + |
| 40 | +* sudo apt-get update |
| 41 | + |
| 42 | +* sudo apt-get install \ |
| 43 | + apt-transport-https \ |
| 44 | + ca-certificates \ |
| 45 | + curl \ |
| 46 | + gnupg-agent \ |
| 47 | + software-properties-common |
| 48 | +* curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
| 49 | + |
| 50 | +* sudo add-apt-repository \ |
| 51 | + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
| 52 | + $(lsb_release -cs) \ |
| 53 | + stable" |
| 54 | + |
| 55 | +* sudo apt-get update |
| 56 | + |
| 57 | +* sudo apt-get install docker-ce docker-ce-cli containerd.io |
| 58 | + |
| 59 | +* sudo docker run hello-world |
| 60 | + |
| 61 | + |
| 62 | +### Keycloack starting ### |
| 63 | +First run only: |
| 64 | +* docker run --name keycloackContainer -d -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=H2 jboss/keycloak |
| 65 | + |
| 66 | +After first run: |
| 67 | +* sudo docker start keycloackContainer |
| 68 | + |
| 69 | +Remember to stop keycloack after usage: |
| 70 | +* sudo docker stop keycloackContainer |
| 71 | + |
| 72 | + |
| 73 | +### Keycloack useful urls ### |
| 74 | +* master: http://localhost:8080/auth/admin |
| 75 | +* users: http://localhost:8080/auth/realms/idp_dacd/account/ |
| 76 | +* saml request: http://localhost:8080/auth/realms/idp_dacd/protocol/saml |
| 77 | +* metadata: http://localhost:8080/auth/realms/idp_dacd/protocol/saml/descriptor |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
0 commit comments