Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion authentik/providers/rac/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from authentik.policies.engine import PolicyEngine
from authentik.policies.views import PolicyAccessView
from authentik.providers.rac.models import ConnectionToken, Endpoint, RACProvider
from authentik.stages.prompt.stage import PLAN_CONTEXT_PROMPT

PLAN_CONNECTION_SETTINGS = "connection_settings"


class RACStartView(PolicyAccessView):
Expand Down Expand Up @@ -109,10 +112,15 @@
return super().dispatch(request, *args, **kwargs)

def get_challenge(self, *args, **kwargs) -> RedirectChallenge:
settings = self.executor.plan.context.get(PLAN_CONNECTION_SETTINGS)
if not settings:
settings = self.executor.plan.context.get(PLAN_CONTEXT_PROMPT, {}).get(

Check warning on line 117 in authentik/providers/rac/views.py

View check run for this annotation

Codecov / codecov/patch

authentik/providers/rac/views.py#L115-L117

Added lines #L115 - L117 were not covered by tests
PLAN_CONNECTION_SETTINGS
)
token = ConnectionToken.objects.create(
provider=self.provider,
endpoint=self.endpoint,
settings=self.executor.plan.context.get("connection_settings", {}),
settings=settings or {},
session=self.request.session["authenticatedsession"],
expires=now() + timedelta_from_string(self.provider.connection_expiry),
expiring=True,
Expand Down
Loading