Last active
November 13, 2023 07:42
-
-
Save xavbeta/f710b69eba7843c006ff11e561e1c2c1 to your computer and use it in GitHub Desktop.
Configurazione Integrazione COHESION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "Configurazione Integrazione COHESION", | |
"provenance": [], | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/xavbeta/f710b69eba7843c006ff11e561e1c2c1/configurazione-integrazione-cohesion.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"#Configurazione dell'integrazione" | |
], | |
"metadata": { | |
"id": "XhINl6YLnU8G" | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"#@markdown ## Tipo di autenticazione\n", | |
"auth_flow = \"SAML2.0 - SPID, CIED-ID, CNS, eIDAS, Utenti di dominio, Cohesion\" #@param [\"SAML2.0 - SPID, CIED-ID, CNS, eIDAS, Utenti di dominio, Cohesion\", \"Cohesion Single Sign On - Password, PIN, ...\"]\n", | |
"auth_flow_translate = {\"SAML2.0 - SPID, CIED-ID, CNS, eIDAS, Utenti di dominio, Cohesion\": \"SAML2\",\n", | |
" \"Cohesion Single Sign On - Password, PIN, ...\": \"Cohesion\"}\n", | |
"auth_flow_id = auth_flow_translate[auth_flow]\n", | |
"\n", | |
"#@markdown ### Livello di autenticazione minimo richiesto\n", | |
"#@markdown ##### scegliendo le autenticazioni più deboli vengono abilitate automaticamente anche le più restrittive\n", | |
"auth_level = \"PIN o SPID L2\" #@param [\"Nome utente e password o SPID L1\", \"PIN o SPID L2\", \"PC a dominio REGIONEMARCHE o SPID L3\"]\n", | |
"auth_level_translate = {\"Nome utente e password o SPID L1\":\"AuthRestriction=0,1,2,3\",\n", | |
" \"PIN o SPID L2\":\"AuthRestriction=1,2,3\",\n", | |
" \"PC a dominio REGIONEMARCHE o SPID L3\":\"AuthRestriction=2,3\"}\n", | |
"auth_level_str = auth_level_translate[auth_level]\n", | |
"\n", | |
"\n", | |
"#@markdown ---\n", | |
"\n", | |
"#@markdown ### ID SITO\n", | |
"#@markdown ##### assegnato in seguito alla richiesta di integrazione\n", | |
"ID_SITO = \"TEST_COHESION\" #@param {type:\"string\"}\n", | |
"\n", | |
"#@markdown ### URL della pagina del sito a cui ritornare in caso di errore di autenticazione.\n", | |
"index_url = \"https://cohesion.regione.marche.it/testcohesion/\" #@param {type:\"string\"}\n", | |
"\n", | |
"#@markdown ### URL della pagina di login del sito\n", | |
"login_url = \"https://cohesion.regione.marche.it/TestCohesion/ValidateFe.aspx?ReturnUrl=%2ftestcohesion%2fprivato%2fPaginaProtetta.aspx\" #@param {type:\"string\"}\n", | |
"\n", | |
"#@markdown ### URL della pagina di logout del sito\n", | |
"logout_url = \"https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx\" #@param {type:\"string\"}\n", | |
"\n", | |
"\n", | |
"#@markdown ---\n", | |
"\n", | |
"#@markdown ### Usa server di produzione, sviluppo o collaudo?\n", | |
"#@markdown ##### a seconda della selezione le richieste verranno redirette verso un sotto dominio specifico (es: cohesion2sviluppo.regione.marche.it)\n", | |
"\n", | |
"subdomain = \"Produzione\" #@param [\"Produzione\", \"Sviluppo\", \"Collaudo\"]\n", | |
"subdomain_translate = {\"Produzione\":\"cohesion2\",\n", | |
" \"Sviluppo\":\"cohesion2sviluppo\",\n", | |
" \"Collaudo\":\"cohesioncollaudo\"}\n", | |
"subdomain_str = subdomain_translate[subdomain]\n", | |
"\n" | |
], | |
"metadata": { | |
"id": "17VATGNfm-HF" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"#@markdown ## Compilare solo per SAML2.0\n", | |
"\n", | |
"\n", | |
"#@markdown ---\n", | |
"#@markdown ### Abilita SPID Professionisti\n", | |
"#@markdown ##### ad uso professionale per Persona Fisica\n", | |
"spid_pf = True #@param {type:\"boolean\"}\n", | |
"\n", | |
"#@markdown ### Abilita SPID Persone Giuridiche\n", | |
"#@markdown ##### ad uso professionale per Persona Giuridica (attributi del cittadino e dell'azienda)\n", | |
"spid_pg = True #@param {type:\"boolean\"}\n", | |
"\n", | |
"\n", | |
"#@markdown ### Abilita SPID Persone Giuridiche\n", | |
"#@markdown ##### per Persona Giuridica (solo attributi dell'azienda)\n", | |
"lp = True #@param {type:\"boolean\"}\n", | |
"\n", | |
"#@markdown ### Abilita Login eIDAS\n", | |
"#@markdown ##### permette l'accesso tramite il nodo eIDAS italiano\n", | |
"eidas = True #@param {type:\"boolean\"}\n", | |
"\n", | |
"#@markdown ### Disattiva l'accesso tramite credenziali Cohesion\n", | |
"#@markdown ##### Solo per i siti in cui l'accesso è riservato ai cittadini\n", | |
"only_citizens = True #@param {type:\"boolean\"}\n", | |
"\n", | |
"\n", | |
"additionalData = [auth_level_str]\n", | |
"\n", | |
"\n", | |
"\n", | |
"if auth_flow_id == 'SAML2':\n", | |
"\n", | |
" check_url = f\"https://{subdomain_str}.regione.marche.it/SPManager/WAYF.aspx\"\n", | |
" web_check_session_SSO = f\"http://{subdomain_str}.regione.marche.it/SPManager/webCheckSessionSSO.aspx\"\n", | |
"\n", | |
" additionalData.append(logout_url)\n", | |
" additionalData.append(\"UType=c\" if only_citizens else \"UType=cd\")\n", | |
" additionalData.append(\"eidas=1\" if eidas else \"eidas=0\")\n", | |
"\n", | |
" spid_pro = []\n", | |
" if spid_pf:\n", | |
" spid_pro.append(\"PF\")\n", | |
" if spid_pg:\n", | |
" spid_pro.append(\"PG\")\n", | |
" if spid_pg:\n", | |
" spid_pro.append(\"LP\")\n", | |
"\n", | |
" if len(spid_pro) > 0:\n", | |
" additionalData.append(f\"purpose={'|'.join(spid_pro)}\")\n", | |
"\n", | |
"else:\n", | |
" check_url = f\"http://{subdomain_str}.regione.marche.it/SSO/Check.aspx\"\n", | |
" web_check_session_SSO = f\"https://{subdomain_str}.regione.marche.it/SSO/webCheckSessionSSO.aspx\"\n", | |
"\n", | |
"#print(';'.join(additionalData))\n", | |
"\n" | |
], | |
"metadata": { | |
"id": "Gjc-rZ1LzLIE" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"authRequest = f\"\"\"<?xml version=\"1.0\" ?>\n", | |
"<dsAuth xmlns=\"http://tempuri.org/Auth.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n", | |
"\t<auth>\n", | |
"\t\t<user/>\n", | |
"\t\t<id_sa/>\n", | |
"\t\t<id_sito>{ID_SITO}</id_sito>\n", | |
"\t\t<esito_auth_sa/>\n", | |
"\t\t<id_sessione_sa/>\n", | |
"\t\t<id_sessione_aspnet_sa/>\n", | |
"\t\t<url_validate>{login_url}</url_validate>\n", | |
"\t\t<url_richiesta>{index_url}</url_richiesta>\n", | |
"\t\t<esito_auth_sso/>\n", | |
"\t\t<id_sessione_sso/>\n", | |
"\t\t<id_sessione_aspnet_sso/>\n", | |
"\t\t<stilesheet>{';'.join(additionalData)}</stilesheet>\n", | |
"\t</auth>\n", | |
"</dsAuth>\"\"\"\n", | |
"\n", | |
"print(authRequest)\n", | |
"\n", | |
"from urllib.parse import unquote\n", | |
"from urllib.parse import quote_plus\n", | |
"import base64\n", | |
"\n", | |
"\n", | |
"message_bytes = authRequest.encode('ascii')\n", | |
"base64_bytes = base64.b64encode(message_bytes)\n", | |
"base64_message = base64_bytes.decode('ascii')\n", | |
"urlencoded = quote_plus(base64_message)\n", | |
"\n", | |
"print(\"\")\n", | |
"print(f\"{check_url}?auth={urlencoded}\")\n" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "w0VyChMq4AY-", | |
"outputId": "2d83fe7a-a860-4650-e9a0-08308dc7a836" | |
}, | |
"execution_count": null, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"<?xml version=\"1.0\" ?>\n", | |
"<dsAuth xmlns=\"http://tempuri.org/Auth.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n", | |
"\t<auth>\n", | |
"\t\t<user/>\n", | |
"\t\t<id_sa/>\n", | |
"\t\t<id_sito>TEST_COHESION</id_sito>\n", | |
"\t\t<esito_auth_sa/>\n", | |
"\t\t<id_sessione_sa/>\n", | |
"\t\t<id_sessione_aspnet_sa/>\n", | |
"\t\t<url_validate>https://cohesion.regione.marche.it/TestCohesion/ValidateFe.aspx?ReturnUrl=%2ftestcohesion%2fprivato%2fPaginaProtetta.aspx</url_validate>\n", | |
"\t\t<url_richiesta>https://cohesion.regione.marche.it/testcohesion/</url_richiesta>\n", | |
"\t\t<esito_auth_sso/>\n", | |
"\t\t<id_sessione_sso/>\n", | |
"\t\t<id_sessione_aspnet_sso/>\n", | |
"\t\t<stilesheet>AuthRestriction=1,2,3;https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx;UType=c;eidas=1;purpose=PF|PG|LP</stilesheet>\n", | |
"\t</auth>\n", | |
"</dsAuth>\n", | |
"\n", | |
"https://cohesion2.regione.marche.it/SPManager/WAYF.aspx?auth=PD94bWwgdmVyc2lvbj0iMS4wIiA%2FPgo8ZHNBdXRoIHhtbG5zPSJodHRwOi8vdGVtcHVyaS5vcmcvQXV0aC54c2QiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiPgoJPGF1dGg%2BCgkJPHVzZXIvPgoJCTxpZF9zYS8%2BCgkJPGlkX3NpdG8%2BVEVTVF9DT0hFU0lPTjwvaWRfc2l0bz4KCQk8ZXNpdG9fYXV0aF9zYS8%2BCgkJPGlkX3Nlc3Npb25lX3NhLz4KCQk8aWRfc2Vzc2lvbmVfYXNwbmV0X3NhLz4KCQk8dXJsX3ZhbGlkYXRlPmh0dHBzOi8vY29oZXNpb24ucmVnaW9uZS5tYXJjaGUuaXQvVGVzdENvaGVzaW9uL1ZhbGlkYXRlRmUuYXNweD9SZXR1cm5Vcmw9JTJmdGVzdGNvaGVzaW9uJTJmcHJpdmF0byUyZlBhZ2luYVByb3RldHRhLmFzcHg8L3VybF92YWxpZGF0ZT4KCQk8dXJsX3JpY2hpZXN0YT5odHRwczovL2NvaGVzaW9uLnJlZ2lvbmUubWFyY2hlLml0L3Rlc3Rjb2hlc2lvbi88L3VybF9yaWNoaWVzdGE%2BCgkJPGVzaXRvX2F1dGhfc3NvLz4KCQk8aWRfc2Vzc2lvbmVfc3NvLz4KCQk8aWRfc2Vzc2lvbmVfYXNwbmV0X3Nzby8%2BCgkJPHN0aWxlc2hlZXQ%2BQXV0aFJlc3RyaWN0aW9uPTEsMiwzO2h0dHBzOi8vY29oZXNpb24ucmVnaW9uZS5tYXJjaGUuaXQvdGVzdGNvaGVzaW9uL3ByaXZhdG8vUGFnaW5hUHJvdGV0dGEuYXNweDtVVHlwZT1jO2VpZGFzPTE7cHVycG9zZT1QRnxQR3xMUDwvc3RpbGVzaGVldD4KCTwvYXV0aD4KPC9kc0F1dGg%2B\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"#CONFIGURAZIONE INTEGRAZIONE" | |
], | |
"metadata": { | |
"id": "l7o4nFwa_nJJ" | |
} | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## **C#**\n", | |
"### Contenuto del file `web.Config`\n", | |
"\n", | |
"http://cohesion.regione.marche.it/cohesioninformativo/Come-integrare-Cohesion/Integrazione-classe-C" | |
], | |
"metadata": { | |
"id": "KL4b1HDI_pNl" | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"web_config = f\"\"\"\n", | |
" ...\n", | |
" <appSettings>\n", | |
" <add key=\\\"sso.check.url\\\" value=\\\"{check_url}\\\"/>\n", | |
" <add key=\\\"sso.webCheckSessionSSO\\\" value=\\\"{web_check_session_SSO}\\\"/>\n", | |
" <add key=\\\"site.URLLogout\\\" value=\"{logout_url}\"/>\n", | |
" <add key=\\\"site.ID_SITO\\\" value=\\\"{ID_SITO}\\\" />\n", | |
" <add key=\\\"sso.additionalData\\\" value=\\\"{';'.join(additionalData)}\\\"/>\n", | |
" </appSettings>\n", | |
" ...\n", | |
" \"\"\"\n", | |
"\n", | |
"print(\"Web.config appSettings\")\n", | |
"print(\"\")\n", | |
"print(web_config)\n" | |
], | |
"metadata": { | |
"id": "7UgeZFxi8Daq", | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"outputId": "e0765685-bb9d-44c9-9d45-6a3b55bd0ec5" | |
}, | |
"execution_count": null, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Web.config appSettings\n", | |
"\n", | |
"\n", | |
" ...\n", | |
" <appSettings>\n", | |
" <add key=\"sso.check.url\" value=\"https://cohesion2.regione.marche.it/SPManager/WAYF.aspx\"/>\n", | |
" <add key=\"sso.webCheckSessionSSO\" value=\"http://cohesion2.regione.marche.it/SPManager/webCheckSessionSSO.aspx\"/>\n", | |
" <add key=\"site.URLLogout\" value=\"https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx\"/>\n", | |
" <add key=\"site.ID_SITO\" value=\"TEST_COHESION\" />\n", | |
" <add key=\"sso.additionalData\" value=\"AuthRestriction=1,2,3;https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx;UType=c;eidas=1;purpose=PF|PG|LP\"/>\n", | |
" </appSettings>\n", | |
" ...\n", | |
" \n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## **Java Servlet**\n", | |
"### Contenuto del file `web.xml`\n", | |
"\n", | |
"http://cohesion.regione.marche.it/cohesioninformativo/Come-integrare-Cohesion/Integrazione-Java" | |
], | |
"metadata": { | |
"id": "Z9a7MqII_vqr" | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"web_xml = f\"\"\"\n", | |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", | |
"<web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\" id=\"WebApp_ID\" version=\"3.0\">\n", | |
"\t<display-name>CohesionServlet</display-name>\n", | |
"\t<servlet>\n", | |
"\t\t<servlet-name>Authentication</servlet-name>\n", | |
"\t\t<servlet-class>it.unicam.cs.cohesion.servlet.AuthServlet</servlet-class>\n", | |
"\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>encryptionKey</param-name>\n", | |
"\t \t\t<param-value></param-value>\n", | |
"\t \t</init-param>\n", | |
"\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>urlRichiesta</param-name>\n", | |
"\t \t\t<param-value>http://localhost:8080/CohesionServlet/login.jsp</param-value>\n", | |
"\t \t</init-param>\n", | |
"\n", | |
"\t\t<init-param>\n", | |
"\t \t\t<param-name>urlCheck</param-name>\n", | |
"\t \t\t<param-value>{check_url}</param-value>\n", | |
"\t \t</init-param>\n", | |
"\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>webSso</param-name>\n", | |
"\t \t\t<param-value>{web_check_session_SSO}</param-value>\n", | |
"\t \t</init-param>\n", | |
"\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>additionalData</param-name>\n", | |
"\t \t\t<param-value>{';'.join(additionalData)}</param-value>\n", | |
"\t \t</init-param>\n", | |
"\t \t<load-on-startup>1</load-on-startup>\n", | |
"\t</servlet>\n", | |
"\n", | |
"\t<servlet>\n", | |
"\t\t<servlet-name>Logout</servlet-name>\n", | |
"\t\t<servlet-class>it.unicam.cs.cohesion.servlet.LogoutServlet</servlet-class>\n", | |
"\n", | |
"\t\t<init-param>\n", | |
"\t \t\t<param-name>webSso</param-name>\n", | |
"\t \t\t<param-value>{web_check_session_SSO}</param-value>\n", | |
"\t \t</init-param>\n", | |
"\n", | |
"\t</servlet>\n", | |
"\t<servlet-mapping>\n", | |
"\t\t<servlet-name>Authentication</servlet-name>\n", | |
"\t\t<url-pattern>/Authentication</url-pattern>\n", | |
"\t</servlet-mapping>\n", | |
"\t\t<servlet-mapping>\n", | |
"\t\t<servlet-name>Logout</servlet-name>\n", | |
"\t\t<url-pattern>/Logout</url-pattern>\n", | |
"\t</servlet-mapping>\n", | |
"</web-app>\n", | |
" \"\"\"\n", | |
"\n", | |
"print(\"web.xml\")\n", | |
"print(\"\")\n", | |
"print(web_xml)" | |
], | |
"metadata": { | |
"id": "lJ_R0yzh_cuy", | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"outputId": "0027a947-aece-4eba-dbdc-f1b571c2bd93" | |
}, | |
"execution_count": null, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"web.xml\n", | |
"\n", | |
"\n", | |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", | |
"<web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\" id=\"WebApp_ID\" version=\"3.0\">\n", | |
"\t<display-name>CohesionServlet</display-name>\n", | |
"\t<servlet>\n", | |
"\t\t<servlet-name>Authentication</servlet-name>\n", | |
"\t\t<servlet-class>it.unicam.cs.cohesion.servlet.AuthServlet</servlet-class>\n", | |
"\t\t\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>encryptionKey</param-name>\n", | |
"\t \t\t<param-value></param-value>\n", | |
"\t \t</init-param>\n", | |
"\t \t\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>urlRichiesta</param-name>\n", | |
"\t \t\t<param-value>http://localhost:8080/CohesionServlet/login.jsp</param-value>\n", | |
"\t \t</init-param>\n", | |
"\t \t\n", | |
"\t\t<init-param>\n", | |
"\t \t\t<param-name>urlCheck</param-name>\n", | |
"\t \t\t<param-value>https://cohesion2.regione.marche.it/SPManager/WAYF.aspx</param-value>\n", | |
"\t \t</init-param>\t\t\n", | |
"\t\t\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>webSso</param-name>\n", | |
"\t \t\t<param-value>http://cohesion2.regione.marche.it/SPManager/webCheckSessionSSO.aspx</param-value>\n", | |
"\t \t</init-param>\n", | |
"\t \t\n", | |
"\t \t<init-param>\n", | |
"\t \t\t<param-name>additionalData</param-name>\n", | |
"\t \t\t<param-value>AuthRestriction=1,2,3;https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx;UType=c;eidas=1;purpose=PF|PG|LP</param-value>\n", | |
"\t \t</init-param>\n", | |
"\t \t<load-on-startup>1</load-on-startup>\n", | |
"\t</servlet>\n", | |
"\t\n", | |
"\t<servlet>\n", | |
"\t\t<servlet-name>Logout</servlet-name>\n", | |
"\t\t<servlet-class>it.unicam.cs.cohesion.servlet.LogoutServlet</servlet-class>\n", | |
"\t\t\n", | |
"\t\t<init-param>\n", | |
"\t \t\t<param-name>webSso</param-name>\n", | |
"\t \t\t<param-value>http://cohesion2.regione.marche.it/SPManager/webCheckSessionSSO.aspx</param-value>\n", | |
"\t \t</init-param>\n", | |
"\t \t\n", | |
"\t</servlet>\n", | |
"\t<servlet-mapping>\n", | |
"\t\t<servlet-name>Authentication</servlet-name>\n", | |
"\t\t<url-pattern>/Authentication</url-pattern>\n", | |
"\t</servlet-mapping>\n", | |
"\t\t<servlet-mapping>\n", | |
"\t\t<servlet-name>Logout</servlet-name>\n", | |
"\t\t<url-pattern>/Logout</url-pattern>\n", | |
"\t</servlet-mapping>\n", | |
"</web-app>\n", | |
" \n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## **PHP**\n", | |
"### Seguire la documentazione\n", | |
"\n", | |
"https://github.com/regione-marche/Cohesion2PHPLibrary" | |
], | |
"metadata": { | |
"id": "naEdX6RGVc5u" | |
} | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## **Python**\n", | |
"### Contenuto del file `config.json`\n", | |
"\n", | |
"https://github.com/regione-marche/Cohesion2PythonIntegrationTest (test app)\n", | |
"\n", | |
"https://github.com/regione-marche/Cohesion2PythonIntegrationModule (python package)\n" | |
], | |
"metadata": { | |
"id": "Fw9iAHGWbVqJ" | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"import json\n", | |
"\n", | |
"config_json = {\n", | |
" \"sso.check.url\": check_url,\n", | |
" \"sso.webCheckSessionSSO\": web_check_session_SSO,\n", | |
" \"sso.additionalData\": ';'.join(additionalData),\n", | |
" \"site.URLLogin\": login_url,\n", | |
" \"site.URLLogout\": logout_url,\n", | |
" \"site.IndexURL\": index_url,\n", | |
" \"site.ID_SITO\": ID_SITO,\n", | |
" \"debug\": True\n", | |
"}\n", | |
"\n", | |
"print(json.dumps(config_json, sort_keys=False, indent=4))" | |
], | |
"metadata": { | |
"id": "_gVipC3GbTNl", | |
"outputId": "316d7bbc-e8e5-43b3-8bba-05ca4e839180", | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
} | |
}, | |
"execution_count": null, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"{\n", | |
" \"sso.check.url\": \"https://cohesioncollaudo.regione.marche.it/SPManager/WAYF.aspx\",\n", | |
" \"sso.webCheckSessionSSO\": \"http://cohesioncollaudo.regione.marche.it/SSO/Check.aspx\",\n", | |
" \"sso.additionalData\": \"AuthRestriction=0,1,2,3;https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx;UType=cd;eidas=1;purpose=PF|PG|LP\",\n", | |
" \"site.URLLogin\": \"https://cohesion.regione.marche.it/TestCohesion/ValidateFe.aspx?ReturnUrl=%2ftestcohesion%2fprivato%2fPaginaProtetta.aspx\",\n", | |
" \"site.URLLogout\": \"https://cohesion.regione.marche.it/testcohesion/privato/PaginaProtetta.aspx\",\n", | |
" \"site.IndexURL\": \"https://cohesion.regione.marche.it/testcohesion/\",\n", | |
" \"site.ID_SITO\": \"TEST_COHESION\",\n", | |
" \"debug\": true\n", | |
"}\n" | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment