authentik.enterprise.endpoints.connectors.google_chrome.stage
1from django.http import HttpResponse 2from django.urls import reverse 3from django.utils.translation import gettext as _ 4 5from authentik.flows.challenge import ( 6 Challenge, 7 ChallengeResponse, 8 FrameChallenge, 9 FrameChallengeResponse, 10) 11from authentik.flows.stage import ChallengeStageView 12 13 14class GoogleChromeStageView(ChallengeStageView): 15 """Endpoint stage""" 16 17 response_class = FrameChallengeResponse 18 19 def get_challenge(self, *args, **kwargs) -> Challenge: 20 return FrameChallenge( 21 data={ 22 "component": "xak-flow-frame", 23 "url": self.request.build_absolute_uri( 24 reverse("authentik_endpoints_connectors_google_chrome:chrome") 25 ), 26 "loading_overlay": True, 27 "loading_text": _("Verifying your browser..."), 28 } 29 ) 30 31 def challenge_valid(self, response: ChallengeResponse) -> HttpResponse: 32 return self.executor.stage_ok()
15class GoogleChromeStageView(ChallengeStageView): 16 """Endpoint stage""" 17 18 response_class = FrameChallengeResponse 19 20 def get_challenge(self, *args, **kwargs) -> Challenge: 21 return FrameChallenge( 22 data={ 23 "component": "xak-flow-frame", 24 "url": self.request.build_absolute_uri( 25 reverse("authentik_endpoints_connectors_google_chrome:chrome") 26 ), 27 "loading_overlay": True, 28 "loading_text": _("Verifying your browser..."), 29 } 30 ) 31 32 def challenge_valid(self, response: ChallengeResponse) -> HttpResponse: 33 return self.executor.stage_ok()
Endpoint stage
response_class =
<class 'authentik.flows.challenge.FrameChallengeResponse'>
20 def get_challenge(self, *args, **kwargs) -> Challenge: 21 return FrameChallenge( 22 data={ 23 "component": "xak-flow-frame", 24 "url": self.request.build_absolute_uri( 25 reverse("authentik_endpoints_connectors_google_chrome:chrome") 26 ), 27 "loading_overlay": True, 28 "loading_text": _("Verifying your browser..."), 29 } 30 )
Return the challenge that the client should solve
def
challenge_valid( self, response: authentik.flows.challenge.ChallengeResponse) -> django.http.response.HttpResponse:
32 def challenge_valid(self, response: ChallengeResponse) -> HttpResponse: 33 return self.executor.stage_ok()
Callback when the challenge has the correct format