From 0b6fca3a12794630fdfdcf81a24a6e1dea154a74 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Fiorentino Date: Thu, 29 Jan 2015 16:19:48 -0300 Subject: [PATCH] Edit README. --- README.rst | 70 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index 6b0afd5..5a80490 100644 --- a/README.rst +++ b/README.rst @@ -85,11 +85,13 @@ Then let's create a Client. Start django shell: ``python manage.py shell``. >>> c = Client(name='Some Client', client_id='123', client_secret='456', response_type='code', redirect_uris=['http://example.com/']) >>> c.save() -******************* -/authorize endpoint -******************* +**************** +Server Endpoints +**************** -Example of an OpenID Authentication Request using the ´´Authorization Code´´ flow. +**/authorize endpoint** + +Example of an OpenID Authentication Request using the ``Authorization Code`` flow. .. code:: curl @@ -98,21 +100,15 @@ Example of an OpenID Authentication Request using the ´´Authorization Code´´ Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded -**** -Code -**** - After the user accepts and authorizes the client application, the server redirects to: .. code:: curl http://example.com/?code=5fb3b172913448acadce6b011af1e75e&state=abcdefgh -We extract the ``code`` param and use it to obtain access token. +The ``code`` param will be use it to obtain access token. -*************** -/token endpoint -*************** +**/token endpoint** .. code:: curl @@ -123,12 +119,56 @@ We extract the ``code`` param and use it to obtain access token. client_id=123&client_secret=456&redirect_uri=http%253A%252F%252Fexample.com%252F&grant_type=authorization_code&code=[CODE]&state=abcdefgh -****************** -/userinfo endpoint -****************** +**/userinfo endpoint** .. code:: curl POST /openid/userinfo/ HTTP/1.1 Host: localhost:8000 Authorization: Bearer [ACCESS_TOKEN] + +********* +Templates +********* + +Add your own templates files inside a folder named ``templates/openid_provider/``. +You can copy the sample html here and edit them with your own styles. + +**Authorize Template** + +.. code:: html + +

Request for Permission

+ +

Client {{ client.name }} would like to access this information of you ...

+ +
+ + {% csrf_token %} + + {{ hidden_inputs }} + + + + + +
+ + {% endblock %} + +**Error Template** + +.. code:: html + +

{{ error }}

+

{{ description }}

+ +************ +Contributing +************ + +We love contributions, so please feel free to fix bugs, improve things, provide documentation. Just submit a Pull Request.