flows: move flow relevant info into ContextualFlowInfo
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
ae8cf00a21
commit
ba1b23c879
|
@ -28,6 +28,14 @@ class ErrorDetailSerializer(PassiveSerializer):
|
||||||
code = CharField()
|
code = CharField()
|
||||||
|
|
||||||
|
|
||||||
|
class ContextualFlowInfo(PassiveSerializer):
|
||||||
|
"""Contextual flow information for a challenge"""
|
||||||
|
|
||||||
|
title = CharField(required=False, allow_blank=True)
|
||||||
|
background = CharField(required=False)
|
||||||
|
cancel_url = CharField()
|
||||||
|
|
||||||
|
|
||||||
class Challenge(PassiveSerializer):
|
class Challenge(PassiveSerializer):
|
||||||
"""Challenge that gets sent to the client based on which stage
|
"""Challenge that gets sent to the client based on which stage
|
||||||
is currently active"""
|
is currently active"""
|
||||||
|
@ -35,8 +43,7 @@ class Challenge(PassiveSerializer):
|
||||||
type = ChoiceField(
|
type = ChoiceField(
|
||||||
choices=[(x.value, x.name) for x in ChallengeTypes],
|
choices=[(x.value, x.name) for x in ChallengeTypes],
|
||||||
)
|
)
|
||||||
title = CharField(required=False, allow_blank=True)
|
flow_info = ContextualFlowInfo()
|
||||||
background = CharField(required=False)
|
|
||||||
component = CharField(default="")
|
component = CharField(default="")
|
||||||
|
|
||||||
response_errors = DictField(
|
response_errors = DictField(
|
||||||
|
|
|
@ -3,6 +3,7 @@ from django.contrib.auth.models import AnonymousUser
|
||||||
from django.http import HttpRequest
|
from django.http import HttpRequest
|
||||||
from django.http.request import QueryDict
|
from django.http.request import QueryDict
|
||||||
from django.http.response import HttpResponse
|
from django.http.response import HttpResponse
|
||||||
|
from django.urls import reverse
|
||||||
from django.views.generic.base import View
|
from django.views.generic.base import View
|
||||||
from rest_framework.request import Request
|
from rest_framework.request import Request
|
||||||
from structlog.stdlib import get_logger
|
from structlog.stdlib import get_logger
|
||||||
|
@ -11,6 +12,7 @@ from authentik.core.models import DEFAULT_AVATAR, User
|
||||||
from authentik.flows.challenge import (
|
from authentik.flows.challenge import (
|
||||||
Challenge,
|
Challenge,
|
||||||
ChallengeResponse,
|
ChallengeResponse,
|
||||||
|
ContextualFlowInfo,
|
||||||
HttpChallengeResponse,
|
HttpChallengeResponse,
|
||||||
WithUserInfoChallenge,
|
WithUserInfoChallenge,
|
||||||
)
|
)
|
||||||
|
@ -93,10 +95,16 @@ class ChallengeStageView(StageView):
|
||||||
|
|
||||||
def _get_challenge(self, *args, **kwargs) -> Challenge:
|
def _get_challenge(self, *args, **kwargs) -> Challenge:
|
||||||
challenge = self.get_challenge(*args, **kwargs)
|
challenge = self.get_challenge(*args, **kwargs)
|
||||||
if "title" not in challenge.initial_data:
|
if "flow_info" not in challenge.initial_data:
|
||||||
challenge.initial_data["title"] = self.executor.flow.title
|
flow_info = ContextualFlowInfo(
|
||||||
if "background" not in challenge.initial_data:
|
data={
|
||||||
challenge.initial_data["background"] = self.executor.flow.background_url
|
"title": self.executor.flow.title,
|
||||||
|
"background": self.executor.flow.background_url,
|
||||||
|
"cancel_url": reverse("authentik_flows:cancel"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
flow_info.is_valid()
|
||||||
|
challenge.initial_data["flow_info"] = flow_info.data
|
||||||
if isinstance(challenge, WithUserInfoChallenge):
|
if isinstance(challenge, WithUserInfoChallenge):
|
||||||
# If there's a pending user, update the `username` field
|
# If there's a pending user, update the `username` field
|
||||||
# this field is only used by password managers.
|
# this field is only used by password managers.
|
||||||
|
|
131
schema.yml
131
schema.yml
|
@ -15347,10 +15347,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-access-denied
|
default: ak-stage-access-denied
|
||||||
|
@ -15363,6 +15361,7 @@ components:
|
||||||
error_message:
|
error_message:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- type
|
- type
|
||||||
ActionEnum:
|
ActionEnum:
|
||||||
enum:
|
enum:
|
||||||
|
@ -15669,10 +15668,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-authenticator-duo
|
default: ak-stage-authenticator-duo
|
||||||
|
@ -15695,6 +15692,7 @@ components:
|
||||||
required:
|
required:
|
||||||
- activation_barcode
|
- activation_barcode
|
||||||
- activation_code
|
- activation_code
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- stage_uuid
|
- stage_uuid
|
||||||
|
@ -15782,10 +15780,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-authenticator-static
|
default: ak-stage-authenticator-static
|
||||||
|
@ -15805,6 +15801,7 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- codes
|
- codes
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- type
|
- type
|
||||||
|
@ -15883,10 +15880,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-authenticator-totp
|
default: ak-stage-authenticator-totp
|
||||||
|
@ -15904,6 +15899,7 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- config_url
|
- config_url
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- type
|
- type
|
||||||
|
@ -16060,10 +16056,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-authenticator-validate
|
default: ak-stage-authenticator-validate
|
||||||
|
@ -16083,6 +16077,7 @@ components:
|
||||||
$ref: '#/components/schemas/DeviceChallenge'
|
$ref: '#/components/schemas/DeviceChallenge'
|
||||||
required:
|
required:
|
||||||
- device_challenges
|
- device_challenges
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- type
|
- type
|
||||||
|
@ -16106,10 +16101,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-authenticator-webauthn
|
default: ak-stage-authenticator-webauthn
|
||||||
|
@ -16127,6 +16120,7 @@ components:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: {}
|
additionalProperties: {}
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- registration
|
- registration
|
||||||
|
@ -16156,10 +16150,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-autosubmit
|
default: ak-stage-autosubmit
|
||||||
|
@ -16177,6 +16169,7 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- attrs
|
- attrs
|
||||||
|
- flow_info
|
||||||
- type
|
- type
|
||||||
- url
|
- url
|
||||||
BackendsEnum:
|
BackendsEnum:
|
||||||
|
@ -16211,10 +16204,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-captcha
|
default: ak-stage-captcha
|
||||||
|
@ -16231,6 +16222,7 @@ components:
|
||||||
site_key:
|
site_key:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- site_key
|
- site_key
|
||||||
|
@ -16416,10 +16408,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-consent
|
default: ak-stage-consent
|
||||||
|
@ -16440,6 +16430,7 @@ components:
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/Permission'
|
$ref: '#/components/schemas/Permission'
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- header_text
|
- header_text
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
|
@ -16512,6 +16503,18 @@ components:
|
||||||
description: 'Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3).'
|
description: 'Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3).'
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
|
ContextualFlowInfo:
|
||||||
|
type: object
|
||||||
|
description: Contextual flow information for a challenge
|
||||||
|
properties:
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
background:
|
||||||
|
type: string
|
||||||
|
cancel_url:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- cancel_url
|
||||||
Coordinate:
|
Coordinate:
|
||||||
type: object
|
type: object
|
||||||
description: Coordinates for diagrams
|
description: Coordinates for diagrams
|
||||||
|
@ -16715,10 +16718,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-dummy
|
default: ak-stage-dummy
|
||||||
|
@ -16729,6 +16730,7 @@ components:
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/ErrorDetail'
|
$ref: '#/components/schemas/ErrorDetail'
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- type
|
- type
|
||||||
DummyChallengeResponseRequest:
|
DummyChallengeResponseRequest:
|
||||||
type: object
|
type: object
|
||||||
|
@ -16875,10 +16877,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-email
|
default: ak-stage-email
|
||||||
|
@ -16889,6 +16889,7 @@ components:
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/ErrorDetail'
|
$ref: '#/components/schemas/ErrorDetail'
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- type
|
- type
|
||||||
EmailChallengeResponseRequest:
|
EmailChallengeResponseRequest:
|
||||||
type: object
|
type: object
|
||||||
|
@ -17668,10 +17669,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-identification
|
default: ak-stage-identification
|
||||||
|
@ -17701,6 +17700,7 @@ components:
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/UILoginButton'
|
$ref: '#/components/schemas/UILoginButton'
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- password_fields
|
- password_fields
|
||||||
- primary_action
|
- primary_action
|
||||||
- type
|
- type
|
||||||
|
@ -21626,10 +21626,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-password
|
default: ak-stage-password
|
||||||
|
@ -21646,6 +21644,7 @@ components:
|
||||||
recovery_url:
|
recovery_url:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- pending_user
|
- pending_user
|
||||||
- pending_user_avatar
|
- pending_user_avatar
|
||||||
- type
|
- type
|
||||||
|
@ -23378,10 +23377,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-flow-sources-plex
|
default: ak-flow-sources-plex
|
||||||
|
@ -23397,6 +23394,7 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- client_id
|
- client_id
|
||||||
|
- flow_info
|
||||||
- slug
|
- slug
|
||||||
- type
|
- type
|
||||||
PlexAuthenticationChallengeResponseRequest:
|
PlexAuthenticationChallengeResponseRequest:
|
||||||
|
@ -23739,10 +23737,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: ak-stage-prompt
|
default: ak-stage-prompt
|
||||||
|
@ -23758,6 +23754,7 @@ components:
|
||||||
$ref: '#/components/schemas/StagePrompt'
|
$ref: '#/components/schemas/StagePrompt'
|
||||||
required:
|
required:
|
||||||
- fields
|
- fields
|
||||||
|
- flow_info
|
||||||
- type
|
- type
|
||||||
PromptChallengeResponseRequest:
|
PromptChallengeResponseRequest:
|
||||||
type: object
|
type: object
|
||||||
|
@ -24199,10 +24196,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: xak-flow-redirect
|
default: xak-flow-redirect
|
||||||
|
@ -24215,6 +24210,7 @@ components:
|
||||||
to:
|
to:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
|
- flow_info
|
||||||
- to
|
- to
|
||||||
- type
|
- type
|
||||||
RefreshTokenModel:
|
RefreshTokenModel:
|
||||||
|
@ -24912,10 +24908,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
$ref: '#/components/schemas/ChallengeChoices'
|
$ref: '#/components/schemas/ChallengeChoices'
|
||||||
title:
|
flow_info:
|
||||||
type: string
|
$ref: '#/components/schemas/ContextualFlowInfo'
|
||||||
background:
|
|
||||||
type: string
|
|
||||||
component:
|
component:
|
||||||
type: string
|
type: string
|
||||||
default: xak-flow-shell
|
default: xak-flow-shell
|
||||||
|
@ -24929,6 +24923,7 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- body
|
- body
|
||||||
|
- flow_info
|
||||||
- type
|
- type
|
||||||
SignatureAlgorithmEnum:
|
SignatureAlgorithmEnum:
|
||||||
enum:
|
enum:
|
||||||
|
|
|
@ -15,8 +15,4 @@ export class FlowURLManager {
|
||||||
return `/flows/-/configure/${stageUuid}/${rest}`;
|
return `/flows/-/configure/${stageUuid}/${rest}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cancel(): string {
|
|
||||||
return "/flows/-/cancel/";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,8 +86,8 @@ export class FlowExecutor extends LitElement implements StageHost {
|
||||||
|
|
||||||
private postUpdate(): void {
|
private postUpdate(): void {
|
||||||
tenant().then(tenant => {
|
tenant().then(tenant => {
|
||||||
if (this.challenge?.title) {
|
if (this.challenge?.flowInfo.title) {
|
||||||
document.title = `${this.challenge.title} - ${tenant.brandingTitle}`;
|
document.title = `${this.challenge.flowInfo.title} - ${tenant.brandingTitle}`;
|
||||||
} else {
|
} else {
|
||||||
document.title = tenant.brandingTitle || TITLE_DEFAULT;
|
document.title = tenant.brandingTitle || TITLE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
@ -124,8 +124,8 @@ export class FlowExecutor extends LitElement implements StageHost {
|
||||||
}).then((challenge) => {
|
}).then((challenge) => {
|
||||||
this.challenge = challenge;
|
this.challenge = challenge;
|
||||||
// Only set background on first update, flow won't change throughout execution
|
// Only set background on first update, flow won't change throughout execution
|
||||||
if (this.challenge?.background) {
|
if (this.challenge?.flowInfo.background) {
|
||||||
this.setBackground(this.challenge.background);
|
this.setBackground(this.challenge.flowInfo.background);
|
||||||
}
|
}
|
||||||
this.postUpdate();
|
this.postUpdate();
|
||||||
}).catch((e: Error) => {
|
}).catch((e: Error) => {
|
||||||
|
@ -271,7 +271,7 @@ export class FlowExecutor extends LitElement implements StageHost {
|
||||||
${this.tenant?.brandingTitle != "authentik" ? html`
|
${this.tenant?.brandingTitle != "authentik" ? html`
|
||||||
<li><a href="https://goauthentik.io">${t`Powered by authentik`}</a></li>
|
<li><a href="https://goauthentik.io">${t`Powered by authentik`}</a></li>
|
||||||
` : html``}
|
` : html``}
|
||||||
${this.challenge?.background?.startsWith("/static") ? html`
|
${this.challenge?.flowInfo.background?.startsWith("/static") ? html`
|
||||||
<li><a href="https://unsplash.com/@danasaki">${t`Background image`}</a></li>
|
<li><a href="https://unsplash.com/@danasaki">${t`Background image`}</a></li>
|
||||||
` : html``}
|
` : html``}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -28,7 +28,7 @@ export class FlowAccessDenied extends BaseStage<AccessDeniedChallenge, FlowChall
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { BaseStage } from "../base";
|
||||||
import "../../../elements/forms/FormElement";
|
import "../../../elements/forms/FormElement";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { AuthenticatorDuoChallenge, StagesApi } from "authentik-api";
|
import { AuthenticatorDuoChallenge, StagesApi } from "authentik-api";
|
||||||
import { DEFAULT_CONFIG } from "../../../api/Config";
|
import { DEFAULT_CONFIG } from "../../../api/Config";
|
||||||
import { AuthenticatorDuoChallengeResponseRequest } from "authentik-api/dist/models/AuthenticatorDuoChallengeResponseRequest";
|
import { AuthenticatorDuoChallengeResponseRequest } from "authentik-api/dist/models/AuthenticatorDuoChallengeResponseRequest";
|
||||||
|
@ -50,7 +49,7 @@ export class AuthenticatorDuoStage extends BaseStage<AuthenticatorDuoChallenge,
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
@ -60,7 +59,7 @@ export class AuthenticatorDuoStage extends BaseStage<AuthenticatorDuoChallenge,
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<img src=${this.challenge.activationBarcode} />
|
<img src=${this.challenge.activationBarcode} />
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { BaseStage } from "../base";
|
||||||
import "../../../elements/forms/FormElement";
|
import "../../../elements/forms/FormElement";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { AuthenticatorStaticChallenge } from "authentik-api";
|
import { AuthenticatorStaticChallenge } from "authentik-api";
|
||||||
import { AuthenticatorStaticChallengeResponseRequest } from "authentik-api/dist/models/AuthenticatorStaticChallengeResponseRequest";
|
import { AuthenticatorStaticChallengeResponseRequest } from "authentik-api/dist/models/AuthenticatorStaticChallengeResponseRequest";
|
||||||
|
|
||||||
|
@ -47,7 +46,7 @@ export class AuthenticatorStaticStage extends BaseStage<AuthenticatorStaticChall
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
@ -57,7 +56,7 @@ export class AuthenticatorStaticStage extends BaseStage<AuthenticatorStaticChall
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<ak-form-element
|
<ak-form-element
|
||||||
|
|
|
@ -14,7 +14,6 @@ import { showMessage } from "../../../elements/messages/MessageContainer";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { MessageLevel } from "../../../elements/messages/Message";
|
import { MessageLevel } from "../../../elements/messages/Message";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { AuthenticatorTOTPChallenge, AuthenticatorTOTPChallengeResponseRequest } from "authentik-api";
|
import { AuthenticatorTOTPChallenge, AuthenticatorTOTPChallengeResponseRequest } from "authentik-api";
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ export class AuthenticatorTOTPStage extends BaseStage<AuthenticatorTOTPChallenge
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
@ -44,7 +43,7 @@ export class AuthenticatorTOTPStage extends BaseStage<AuthenticatorTOTPChallenge
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<input type="hidden" name="otp_uri" value=${this.challenge.configUrl} />
|
<input type="hidden" name="otp_uri" value=${this.challenge.configUrl} />
|
||||||
|
|
|
@ -162,7 +162,7 @@ export class AuthenticatorValidateStage extends BaseStage<AuthenticatorValidatio
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
${this.selectedDeviceChallenge ? "" : html`<p class="pf-c-login__main-header-desc">
|
${this.selectedDeviceChallenge ? "" : html`<p class="pf-c-login__main-header-desc">
|
||||||
${t`Select an identification method.`}
|
${t`Select an identification method.`}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import "../../../elements/forms/FormElement";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import { PasswordManagerPrefill } from "../identification/IdentificationStage";
|
import { PasswordManagerPrefill } from "../identification/IdentificationStage";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { AuthenticatorValidationChallenge } from "authentik-api/dist/models/AuthenticatorValidationChallenge";
|
import { AuthenticatorValidationChallenge } from "authentik-api/dist/models/AuthenticatorValidationChallenge";
|
||||||
import { AuthenticatorValidationChallengeResponseRequest, DeviceChallenge } from "authentik-api";
|
import { AuthenticatorValidationChallengeResponseRequest, DeviceChallenge } from "authentik-api";
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@ export class AuthenticatorValidateStageWebCode extends BaseStage<AuthenticatorVa
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<ak-form-element
|
<ak-form-element
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage";
|
||||||
import "../../../elements/forms/FormElement";
|
import "../../../elements/forms/FormElement";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { AuthenticatorValidationChallenge } from "authentik-api/dist/models/AuthenticatorValidationChallenge";
|
import { AuthenticatorValidationChallenge } from "authentik-api/dist/models/AuthenticatorValidationChallenge";
|
||||||
import { AuthenticatorValidationChallengeResponseRequest, DeviceChallenge } from "authentik-api";
|
import { AuthenticatorValidationChallengeResponseRequest, DeviceChallenge } from "authentik-api";
|
||||||
|
|
||||||
|
@ -49,7 +48,7 @@ export class AuthenticatorValidateStageWebDuo extends BaseStage<AuthenticatorVal
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ export class WebAuthnAuthenticatorRegisterStage extends BaseStage<AuthenticatorW
|
||||||
render(): TemplateResult {
|
render(): TemplateResult {
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge?.title}
|
${this.challenge?.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class AutosubmitStage extends BaseStage<AutosubmitChallenge, AutoSubmitCh
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { BaseStage } from "../base";
|
||||||
import "../../../elements/forms/FormElement";
|
import "../../../elements/forms/FormElement";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { CaptchaChallenge, CaptchaChallengeResponseRequest } from "authentik-api";
|
import { CaptchaChallenge, CaptchaChallengeResponseRequest } from "authentik-api";
|
||||||
|
|
||||||
@customElement("ak-stage-captcha")
|
@customElement("ak-stage-captcha")
|
||||||
|
@ -58,7 +57,7 @@ export class CaptchaStage extends BaseStage<CaptchaChallenge, CaptchaChallengeRe
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
@ -68,7 +67,7 @@ export class CaptchaStage extends BaseStage<CaptchaChallenge, CaptchaChallengeRe
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<div class="ak-loading">
|
<div class="ak-loading">
|
||||||
|
|
|
@ -10,7 +10,6 @@ import AKGlobal from "../../../authentik.css";
|
||||||
import { BaseStage } from "../base";
|
import { BaseStage } from "../base";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { ConsentChallenge, ConsentChallengeResponseRequest } from "authentik-api";
|
import { ConsentChallenge, ConsentChallengeResponseRequest } from "authentik-api";
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ export class ConsentStage extends BaseStage<ConsentChallenge, ConsentChallengeRe
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
@ -40,7 +39,7 @@ export class ConsentStage extends BaseStage<ConsentChallenge, ConsentChallengeRe
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<div class="pf-c-form__group">
|
<div class="pf-c-form__group">
|
||||||
|
|
|
@ -28,7 +28,7 @@ export class DummyStage extends BaseStage<DummyChallenge, DummyChallengeResponse
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
|
@ -27,7 +27,7 @@ export class EmailStage extends BaseStage<EmailChallenge, EmailChallengeResponse
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
|
@ -206,7 +206,7 @@ export class IdentificationStage extends BaseStage<IdentificationChallenge, Iden
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
|
@ -12,7 +12,6 @@ import "../../../elements/forms/FormElement";
|
||||||
import "../../../elements/EmptyState";
|
import "../../../elements/EmptyState";
|
||||||
import { PasswordManagerPrefill } from "../identification/IdentificationStage";
|
import { PasswordManagerPrefill } from "../identification/IdentificationStage";
|
||||||
import "../../FormStatic";
|
import "../../FormStatic";
|
||||||
import { FlowURLManager } from "../../../api/legacy";
|
|
||||||
import { PasswordChallenge, PasswordChallengeResponseRequest } from "authentik-api";
|
import { PasswordChallenge, PasswordChallengeResponseRequest } from "authentik-api";
|
||||||
|
|
||||||
@customElement("ak-stage-password")
|
@customElement("ak-stage-password")
|
||||||
|
@ -31,7 +30,7 @@ export class PasswordStage extends BaseStage<PasswordChallenge, PasswordChalleng
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
@ -41,7 +40,7 @@ export class PasswordStage extends BaseStage<PasswordChallenge, PasswordChalleng
|
||||||
userAvatar="${this.challenge.pendingUserAvatar}"
|
userAvatar="${this.challenge.pendingUserAvatar}"
|
||||||
user=${this.challenge.pendingUser}>
|
user=${this.challenge.pendingUser}>
|
||||||
<div slot="link">
|
<div slot="link">
|
||||||
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
|
<a href="${this.challenge.flowInfo.cancelUrl}">${t`Not you?`}</a>
|
||||||
</div>
|
</div>
|
||||||
</ak-form-static>
|
</ak-form-static>
|
||||||
<input name="username" autocomplete="username" type="hidden" value="${this.challenge.pendingUser}">
|
<input name="username" autocomplete="username" type="hidden" value="${this.challenge.pendingUser}">
|
||||||
|
|
|
@ -111,7 +111,7 @@ export class PromptStage extends BaseStage<PromptChallenge, PromptChallengeRespo
|
||||||
}
|
}
|
||||||
return html`<header class="pf-c-login__main-header">
|
return html`<header class="pf-c-login__main-header">
|
||||||
<h1 class="pf-c-title pf-m-3xl">
|
<h1 class="pf-c-title pf-m-3xl">
|
||||||
${this.challenge.title}
|
${this.challenge.flowInfo.title}
|
||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="pf-c-login__main-body">
|
<div class="pf-c-login__main-body">
|
||||||
|
|
Reference in New Issue