Skip to content

Commit

Permalink
Fix minor errors of demo-bottle and add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed Jul 17, 2015
1 parent b75e06c commit 4c8db53
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion demo-bottle/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions demo-bottle/saml/advanced_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -26,4 +27,4 @@
"url": "http://sp.example.com"
}
}
}
}
2 changes: 1 addition & 1 deletion demo-bottle/saml/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sp": {
"entityId": "https://<sp_domain>/metadata/",
"assertionConsumerService": {
"url": "https://<sp_domain>/?acs",
"url": "https://<sp_domain/acs/",
"binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
},
"singleLogoutService": {
Expand Down

0 comments on commit 4c8db53

Please sign in to comment.