providers/oidc: add template for consent

This commit is contained in:
Jens Langhammer
2020-06-19 20:19:31 +02:00
parent fa5c2bd85c
commit 3a40e50fa0
2 changed files with 24 additions and 1 deletions

View File

@ -1,4 +1,5 @@
"""passbook OIDC Views"""
from passbook.stages.consent.stage import PLAN_CONTEXT_CONSENT_TEMPLATE
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpRequest, HttpResponse, JsonResponse
@ -27,7 +28,7 @@ from passbook.providers.oidc.models import OpenIDProvider
LOGGER = get_logger()
PLAN_CONTEXT_PARAMS = "params"
PLAN_CONTEXT_SCOPES = "scopes"
class AuthorizationFlowInitView(AccessMixin, LoginRequiredMixin, View):
"""OIDC Flow initializer, checks access to application and starts flow"""
@ -59,6 +60,8 @@ class AuthorizationFlowInitView(AccessMixin, LoginRequiredMixin, View):
PLAN_CONTEXT_SSO: True,
PLAN_CONTEXT_APPLICATION: application,
PLAN_CONTEXT_PARAMS: endpoint.params,
PLAN_CONTEXT_SCOPES: endpoint.get_scopes_information(),
PLAN_CONTEXT_CONSENT_TEMPLATE: "providers/oidc/consent.html"
},
)
plan.append(in_memory_stage(OIDCStage))