diff --git a/CHANGELOG.md b/CHANGELOG.md
index a45c483..864877a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
### [Unreleased]
+##### Added
+- Polish translations.
+- Examples section in documentation.
+
+##### Fixed
+- CORS in discovery and userinfo endpoint.
+- Client type public bug when created using the admin.
+
### [0.3.7] - 2016-08-31
##### Added
diff --git a/docs/index.rst b/docs/index.rst
index 43974a5..e0f7ff2 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -31,6 +31,7 @@ Contents:
sections/userconsent
sections/oauth2
sections/settings
+ sections/examples
sections/contribute
..
diff --git a/docs/sections/contribute.rst b/docs/sections/contribute.rst
index f7a07e9..091d28a 100644
--- a/docs/sections/contribute.rst
+++ b/docs/sections/contribute.rst
@@ -31,7 +31,7 @@ Improve Documentation
We use `Sphinx `_ for generate this documentation. I you want to add or modify something just:
-* Install Sphinx ``pip install sphinx`` and this theme ``pip install sphinx-rtd-theme``.
+* Install Sphinx (``pip install sphinx``) and the auto-build tool (``pip install sphinx-autobuild``).
* Move inside the docs folder. ``cd docs/``
-* Generate the HTML. ``make html``
-* Open ``docs/_build/html/index.html`` on a browser.
+* Generate and watch docs by running ``sphinx-autobuild . _build/``.
+* Open ``http://127.0.0.1:8000`` on a browser.
diff --git a/docs/sections/examples.rst b/docs/sections/examples.rst
new file mode 100644
index 0000000..d1e8254
--- /dev/null
+++ b/docs/sections/examples.rst
@@ -0,0 +1,94 @@
+.. _examples:
+
+Examples
+########
+
+Pure JS client using Implicit Flow
+==================================
+
+Testing OpenID Connect flow can be as simple as putting one file with a few functions on the client and calling the provider. Let me show.
+
+**01. Setup the provider**
+
+You can use the example project code to run your OIDC Provider at ``localhost:8000``.
+
+Go to the admin site and create a public client with a response_type ``id_token token`` and a redirect_uri ``http://localhost:3000``.
+
+.. note::
+ Remember to create at least one **RSA Key** for the server. ``python manage.py creatersakey``
+
+**02. Create the client**
+
+As relying party we are going to use a JS library created by Nat Sakimura. `Here is the article `_.
+
+**index.html**::
+
+
+
+
+
+ OIDC RP
+
+
+
+
+
+
OpenID Connect RP Example
+
+
+
+
+
+
+
+
+
+
+
+.. note::
+ Remember that you must set your client_id (line 21).
+
+**03. Make an authorization request**
+
+By clicking the login button an authorization request has been made to the provider. After you accept it, the provider will redirect back to your previously registered ``redirect_uri`` with all the tokens requested.
+
+**04. Requesting user information**
+
+Now having the access_token in your hands you can request the user information by making a request to the ``/userinfo`` endpoint of the provider.
+
+In this example we display information in the alert box.
diff --git a/example_project/README.md b/example_project/README.md
index ab1fd6c..0a8dfef 100644
--- a/example_project/README.md
+++ b/example_project/README.md
@@ -1,6 +1,6 @@
# Example Project
-![Example Project](http://i.imgur.com/IK3OZjx.png)
+![Example Project](https://s17.postimg.org/4jjj8lavj/Screen_Shot_2016_09_07_at_15_58_43.png)
Run your own OIDC provider in a second. This is a Django app with all the necessary things to work with `django-oidc-provider` package.
@@ -31,6 +31,7 @@ Run your provider.
```bash
$ python manage.py migrate
$ python manage.py creatersakey
+$ python manage.py createsuperuser
$ python manage.py runserver
```
diff --git a/example_project/manage.py b/example_project/manage.py
index ff8c2cf..7bf6f3d 100755
--- a/example_project/manage.py
+++ b/example_project/manage.py
@@ -2,8 +2,8 @@
import os
import sys
-if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "provider_app.settings")
+if __name__ == '__main__':
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
from django.core.management import execute_from_command_line
diff --git a/example_project/provider_app/__init__.py b/example_project/myapp/__init__.py
similarity index 100%
rename from example_project/provider_app/__init__.py
rename to example_project/myapp/__init__.py
diff --git a/example_project/provider_app/settings.py b/example_project/myapp/settings.py
similarity index 94%
rename from example_project/provider_app/settings.py
rename to example_project/myapp/settings.py
index d2a28af..bcde181 100644
--- a/example_project/provider_app/settings.py
+++ b/example_project/myapp/settings.py
@@ -20,7 +20,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
- 'provider_app',
+ 'myapp',
'oidc_provider',
]
@@ -50,9 +50,9 @@ TEMPLATES = [
},
]
-ROOT_URLCONF = 'provider_app.urls'
+ROOT_URLCONF = 'myapp.urls'
-WSGI_APPLICATION = 'provider_app.wsgi.application'
+WSGI_APPLICATION = 'myapp.wsgi.application'
# Database
diff --git a/example_project/myapp/templates/base.html b/example_project/myapp/templates/base.html
new file mode 100644
index 0000000..cca08d0
--- /dev/null
+++ b/example_project/myapp/templates/base.html
@@ -0,0 +1,46 @@
+{% load i18n staticfiles %}
+
+
+
+
+
+
+
+
+
+ {% trans 'OpenID Provider Example' %}
+
+
+
+
+
+
+
+
+
+