Skip to content

Commit

Permalink
Work on end_session_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
juanifioren committed Dec 4, 2024
1 parent 6a250a8 commit 98b9810
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.sortImports": "explicit"
}
},
"python.formatting.provider": "black",
Expand Down
75 changes: 38 additions & 37 deletions example/app/settings.py
Original file line number Diff line number Diff line change
@@ -1,74 +1,75 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(__file__))


SECRET_KEY = 'c14d549c574e4d8cf162404ef0b04598'
SECRET_KEY = "c14d549c574e4d8cf162404ef0b04598"

DEBUG = True

TEMPLATE_DEBUG = False

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = ["*"]

# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
'oidc_provider',
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"app",
"oidc_provider",
]

MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'oidc_provider.middleware.SessionManagementMiddleware',
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"oidc_provider.middleware.SessionManagementMiddleware",
]
MIDDLEWARE = MIDDLEWARE_CLASSES

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]

ROOT_URLCONF = 'app.urls'
ROOT_URLCONF = "app.urls"

WSGI_APPLICATION = 'app.wsgi.application'
WSGI_APPLICATION = "app.wsgi.application"

# Database

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'DATABASE.sqlite3'),
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "DATABASE.sqlite3"),
}
}

# Internationalization

LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = "en-us"

TIME_ZONE = 'UTC'
TIME_ZONE = "UTC"

USE_I18N = True

Expand All @@ -78,14 +79,14 @@

# Static files (CSS, JavaScript, Images)

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

# Custom settings

LOGIN_REDIRECT_URL = '/'
LOGIN_REDIRECT_URL = "/"

# OIDC Provider settings

SITE_URL = 'http://localhost:8000'
SITE_URL = "http://localhost:8000"
OIDC_SESSION_MANAGEMENT_ENABLE = True
6 changes: 3 additions & 3 deletions example/app/templates/oidc_provider/authorize.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% load i18n staticfiles %}
{% load i18n static %}

{% block content %}

Expand All @@ -16,10 +16,10 @@ <h2>{% trans 'Request for Permission' %}</h2>
{% endfor %}
</ul>
<br>
<input type="submit" class="btn btn-primary btn-block btn-lg" name="allow" value="{% trans 'Accept' %}" />
<input type="submit" class="btn btn-primary btn-block btn-lg" name="allow" value="{% trans 'Accept' %}" />
<input type="submit" class="btn btn-secondary btn-block" value="{% trans 'Decline' %}" />
</form>
</div>
</div>

{% endblock %}
{% endblock %}

0 comments on commit 98b9810

Please sign in to comment.