| 1 |
from django.urls import include, path |
| 2 |
|
| 3 |
from allauth.idp.oidc import app_settings, views |
| 4 |
|
| 5 |
|
| 6 |
app_name = "oidc" |
| 7 |
|
| 8 |
|
| 9 |
_api_urlpatterns = [ |
| 10 |
path( |
| 11 |
"token", |
| 12 |
views.token, |
| 13 |
name="token", |
| 14 |
), |
| 15 |
path( |
| 16 |
"revoke", |
| 17 |
views.revoke, |
| 18 |
name="revoke", |
| 19 |
), |
| 20 |
path( |
| 21 |
"device/code", |
| 22 |
views.device_code, |
| 23 |
name="device_code", |
| 24 |
), |
| 25 |
] |
| 26 |
|
| 27 |
if app_settings.INTROSPECTION_ENABLED: |
| 28 |
_api_urlpatterns.append( |
| 29 |
path( |
| 30 |
"introspect", |
| 31 |
views.introspect, |
| 32 |
name="introspect", |
| 33 |
), |
| 34 |
) |
| 35 |
|
| 36 |
if not app_settings.USERINFO_ENDPOINT: |
| 37 |
_api_urlpatterns.append( |
| 38 |
path( |
| 39 |
"userinfo", |
| 40 |
views.user_info, |
| 41 |
name="userinfo", |
| 42 |
) |
| 43 |
) |
| 44 |
|
| 45 |
if app_settings.DCR_ENABLED: |
| 46 |
_api_urlpatterns.append( |
| 47 |
path( |
| 48 |
"clients", |
| 49 |
views.client_registration, |
| 50 |
name="client_registration", |
| 51 |
) |
| 52 |
) |
| 53 |
|
| 54 |
|
| 55 |
urlpatterns = [ |
| 56 |
path( |
| 57 |
".well-known/", |
| 58 |
include( |
| 59 |
[ |
| 60 |
path( |
| 61 |
"openid-configuration", |
| 62 |
views.configuration, |
| 63 |
name="configuration", |
| 64 |
), |
| 65 |
path( |
| 66 |
"jwks.json", |
| 67 |
views.jwks, |
| 68 |
name="jwks", |
| 69 |
), |
| 70 |
] |
| 71 |
), |
| 72 |
), |
| 73 |
path( |
| 74 |
"identity/", |
| 75 |
include( |
| 76 |
[ |
| 77 |
path( |
| 78 |
"o/", |
| 79 |
include( |
| 80 |
[ |
| 81 |
path( |
| 82 |
"authorize", |
| 83 |
views.authorization, |
| 84 |
name="authorization", |
| 85 |
), |
| 86 |
path( |
| 87 |
"device", |
| 88 |
views.device_authorization, |
| 89 |
name="device_authorization", |
| 90 |
), |
| 91 |
path( |
| 92 |
"logout", |
| 93 |
views.logout, |
| 94 |
name="logout", |
| 95 |
), |
| 96 |
path("api/", include(_api_urlpatterns)), |
| 97 |
] |
| 98 |
), |
| 99 |
) |
| 100 |
] |
| 101 |
), |
| 102 |
), |
| 103 |
] |