You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library allow *Single Sign On* (SSO) integration into Django through the [Open ID Connect (OIDC)]() protocol.
11
20
@@ -19,13 +28,13 @@ If you are not satisfied with the default configuration, take a look at the cook
19
28
20
29
## Features
21
30
22
-
- Easy configuration through premade [`Provider`](https://django-pyoidc.readthedocs.io/en/latest/user.html#providers) classes.
31
+
- Easy configuration through premade `Provider` classes (see the list [here](https://django-pyoidc.readthedocs.io/latest/reference.html#providers)
23
32
- Authenticate users from multiple providers
24
33
- Bearer authentication support for [django-rest-framework](https://www.django-rest-framework.org/) integration (**single provider**)
25
-
- Easy integration with the [Django permission system](https://django-pyoidc.readthedocs.io/en/latest/how-to.html#use-the-django-permission-system-with-oidc)
34
+
- Easy integration with the [Django permission system](https://django-pyoidc.readthedocs.io/latest/how-to.html#use-the-django-permission-system-with-oidc)
26
35
- Highly customizable design that should suit most needs
27
36
- Support back-channel logout
28
-
- Support service accounts (accounts for machine-to-machine uses)
37
+
- Support service accounts (accounts for machine-to-machine authentication)
29
38
- Sane and secure defaults settings
30
39
31
40
## Roadmap
@@ -43,7 +52,7 @@ We were also heavily inspired by :
43
52
*[`mozilla-django-oidc`](https://github.com/mozilla/mozilla-django-oidc) for it's login redirection URI management
44
53
*[`django-auth-oidc`](https://gitlab.com/aiakos/django-auth-oidc) for it's hook system
45
54
46
-
If you want to understand why we decided to implement our own library, this is documented [here](https://django-pyoidc.readthedocs.io/en/latest/explanation.html#other-oidc-libraries).
55
+
If you want to understand why we decided to implement our own library, this is documented [here](https://django-pyoidc.readthedocs.io/latest/explanation.html).
47
56
48
57
## Documentation
49
58
@@ -76,13 +85,13 @@ MIDDLEWARE = [
76
85
]
77
86
```
78
87
79
-
Now is time to run a migrate operation, as we create a database table ([read why here](https://django-pyoidc.readthedocs.io/en/latest/explanation.html#cache-management)). Run in your project dir :
88
+
Now is time to run a migrate operation, as we create a database table ([read why here](https://django-pyoidc.readthedocs.io/latest/explanation.html#about-caching)). Run in your project dir :
80
89
81
90
```
82
91
./manage.py migrate
83
92
```
84
93
85
-
We also need a cache ([read why here](https://django-pyoidc.readthedocs.io/en/latest/explanation.html#cache-management)), so let's configure a dumb one for development purposes. Add in your `settings.py` :
94
+
We also need a cache ([read why here](https://django-pyoidc.readthedocs.io/latest/explanation.html#about-caching)), so let's configure a dumb one for development purposes. Add in your `settings.py` :
86
95
87
96
```python
88
97
CACHES= {
@@ -93,7 +102,7 @@ CACHES = {
93
102
}
94
103
```
95
104
96
-
Now you can pick an identity provider from the [available providers](https://django-pyoidc.readthedocs.io/en/latest/user.html#providers). Providers class are a quick way to generate the library configuration and URLs. You can also configure the settings manually, but this is not recommended if you are not familiar with the OpendID Connect (OIDC) protocol.
105
+
Now you can pick an identity provider from the [available providers](https://django-pyoidc.readthedocs.io/latest/reference.html#providers). Providers class are a quick way to generate the library configuration and URLs. You can also configure the settings manually, but this is not recommended if you are not familiar with the OpendID Connect (OIDC) protocol.
97
106
98
107
Add the following `DJANGO_PYOIDC` to your `settings.py` :
99
108
@@ -135,11 +144,11 @@ urlpatterns = [
135
144
136
145
And you are ready to go !
137
146
138
-
If you struggle with those instructions, take a look at [the quickstart tutorial](https://django-pyoidc.readthedocs.io/en/latest/tutorial.html#requirements).
147
+
If you struggle with those instructions, take a look at [the quickstart tutorial](https://django-pyoidc.readthedocs.io/latest/tutorial.html).
139
148
140
149
## Usage/Examples
141
150
142
-
We wrote an extensive collection of 'how-to' guides in the [documentation](https://django-pyoidc.readthedocs.io/en/latest/how-to.html).
151
+
We wrote an extensive collection of 'how-to' guides in the [documentation](https://django-pyoidc.readthedocs.io/latest/index.html).
Copy file name to clipboardExpand all lines: docs/how-to.rst
+3-5
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Here is how it looks if we extend the configuration made in :ref:`Configure the
55
55
},
56
56
57
57
58
-
See :ref:`Hook settings`for more information on the function path syntax.
58
+
See :ref:`Hook settings<settings_hook>`for more information on the function path syntax.
59
59
60
60
You should now see a message on login/logout ! 🎉
61
61
@@ -136,7 +136,7 @@ group named *admin*. If you are not familiar with the claims available in your t
136
136
137
137
To have this function called instead of the default one, you need to modify your settings so that :ref:`hook_get_user` points to the function that we just wrote.
138
138
139
-
The value of this setting should be : ``<my_app>.oidc:login_function`` (see :ref:`Hook settings`for more information on this syntax).
139
+
The value of this setting should be : ``<my_app>.oidc:login_function`` (see :ref:`Hook settings<settings_hook>`for more information on this syntax).
140
140
141
141
If you configured your settings manually (without using the providers system), you can add the key directly.
142
142
@@ -267,11 +267,9 @@ TODO: RedirectDemo now exists, where do I connect it?
267
267
Use multiple identity providers
268
268
===============================
269
269
270
-
**TODO**
271
-
272
270
This library natively supports multiples identity providers.
273
271
274
-
You already have to specify a provider name when you configure your settings (either automatically by using a provider, or :ref:`manually <Providers settings>`).
272
+
You already have to specify a provider name when you configure your settings (either automatically by using a provider, or :ref:`manually <provider-class-setting>`).
275
273
276
274
In a multi-provider setup, the settings look like this :
Copy file name to clipboardExpand all lines: docs/tutorial.rst
+5-1
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ Configure a cache backend
113
113
*************************
114
114
115
115
**You must have a cache backend** for this library to work ! The OIDC protocol is very statefull and we use Django cache system to store data.
116
-
If you want to understand why, you can read the :ref:`Cache Management` page.
116
+
If you want to understand why, you can read the :ref:`Cache management <expl_cache>` page.
117
117
118
118
For the sake of this tutorial, you can use this cache management snippet (it should be pasted in your ``settings.py``) :
119
119
@@ -129,6 +129,8 @@ For the sake of this tutorial, you can use this cache management snippet (it sho
129
129
.. warning::
130
130
Do not use those settings in production ! Go read the `django documentation <https://docs.djangoproject.com/en/stable/topics/cache/#setting-up-the-cache>`_ for more details.
131
131
132
+
.. _tuto_settings:
133
+
132
134
Configure the library
133
135
*********************
134
136
@@ -216,6 +218,8 @@ This will create 4 views in your URL configuration. They all have a name that de
216
218
217
219
You should now be able to use the view names from this library to redirect the user to a login/logout page.
0 commit comments