From 4c8db5379fecbf77252b003aeeb1ab66bc7732c5 Mon Sep 17 00:00:00 2001 From: Sixto Martin Date: Fri, 17 Jul 2015 13:31:49 +0200 Subject: [PATCH] Fix minor errors of demo-bottle and add some documentation --- README.md | 11 ++++++++--- demo-bottle/index.py | 2 +- demo-bottle/saml/advanced_settings.json | 5 +++-- demo-bottle/saml/settings.json | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e538bb71..7a10e277 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Key features: * **Easy to use** - Programmer will be allowed to code high-level and low-level programming, 2 easy to use APIs are available. * **Tested** - Thoroughly tested. - * **Popular** - OneLogin's customers use it. Add easy support to your django/flask web projects. + * **Popular** - OneLogin's customers use it. Add easy support to your django/flask/bottle web projects. Installation @@ -108,7 +108,7 @@ Getting started ### Knowing the toolkit ### -The new OneLogin SAML Toolkit contains different folders (certs, lib, demo-django, demo-flask and tests) and some files. +The new OneLogin SAML Toolkit contains different folders (certs, lib, demo-django, demo-flask, demo-bottle and tests) and some files. Let's start describing them: @@ -140,6 +140,11 @@ If you want to create self-signed certs, you can do it at the https://www.samlto openssl req -new -x509 -days 3652 -nodes -out sp.crt -keyout saml.key ``` +#### demo-bottle #### + +This folder contains a Bottle project that will be used as demo to show how to add SAML support to the Bottle Framework. index.py contains all the logic of the demo project, 'templates' is the Bottle templates of the project and 'saml' is a folder that contains the 'certs' folder that could be used to store the x509 public and private key, and the saml toolkit settings (settings.json and advanced_settings.json). + + #### demo-flask #### This folder contains a Flask project that will be used as demo to show how to add SAML support to the Flask Framework. 'index.py' is the main flask file that has all the code, this file uses the templates stored at the 'templates' folder. In the 'saml' folder we found the 'certs' folder to store the x509 public and private key, and the saml toolkit settings (settings.json and advanced_settings.json). @@ -176,7 +181,7 @@ There are two ways to provide the settings information: * Use a json object with the setting data and provide it directly to the constructor of the class (if your toolkit integation requires certs, remember to provide the 'custom_base_path' as part of the settings or as a parameter in the constructor. -In the demo-django and in the demo-flask folders you will find a 'saml' folder, inside there is a 'certs' folder and a settings.json and a advanced_settings.json files. Those files contain the settings for the saml toolkit. Copy them in your project and set the correct values. +In the demo-django, demo-flask and demo-bottle folders you will find a 'saml' folder, inside there is a 'certs' folder and a settings.json and a advanced_settings.json files. Those files contain the settings for the saml toolkit. Copy them in your project and set the correct values. This is the settings.json file: diff --git a/demo-bottle/index.py b/demo-bottle/index.py index aa23e864..bf201066 100644 --- a/demo-bottle/index.py +++ b/demo-bottle/index.py @@ -39,7 +39,7 @@ def prepare_bottle_request(req): } -@app.route('/acs', method='POST') +@app.route('/acs/', method='POST') @jinja2_view('index.html', template_lookup=['templates']) def index(): req = prepare_bottle_request(request) diff --git a/demo-bottle/saml/advanced_settings.json b/demo-bottle/saml/advanced_settings.json index e336fe9d..4ea002ad 100644 --- a/demo-bottle/saml/advanced_settings.json +++ b/demo-bottle/saml/advanced_settings.json @@ -7,7 +7,8 @@ "signMetadata": false, "wantMessagesSigned": false, "wantAssertionsSigned": false, - "wantNameIdEncrypted": false + "wantNameIdEncrypted": false, + "signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1" }, "contactPerson": { "technical": { @@ -26,4 +27,4 @@ "url": "http://sp.example.com" } } -} \ No newline at end of file +} diff --git a/demo-bottle/saml/settings.json b/demo-bottle/saml/settings.json index 142911f1..fdb13acd 100644 --- a/demo-bottle/saml/settings.json +++ b/demo-bottle/saml/settings.json @@ -4,7 +4,7 @@ "sp": { "entityId": "https:///metadata/", "assertionConsumerService": { - "url": "https:///?acs", + "url": "https://