File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
common/djangoapps/third_party_auth
openedx/core/djangoapps/user_authn/views Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -803,7 +803,10 @@ def get_url_params(self):
803803
804804 def is_active_for_pipeline (self , pipeline ):
805805 """ Is this provider being used for the specified pipeline? """
806- return self .backend_name == pipeline ['backend' ] and self .slug == pipeline ['kwargs' ]['response' ]['idp_name' ]
806+ try :
807+ return self .backend_name == pipeline ['backend' ] and self .slug == pipeline ['kwargs' ]['response' ]['idp_name' ]
808+ except KeyError :
809+ return False
807810
808811 def match_social_auth (self , social_auth ):
809812 """ Is this provider being used for this UserSocialAuth entry? """
Original file line number Diff line number Diff line change @@ -197,9 +197,15 @@ def login_and_registration_form(request, initial_mode="login"):
197197 saml_provider = False
198198 running_pipeline = pipeline .get (request )
199199 if running_pipeline :
200- saml_provider , __ = third_party_auth .utils .is_saml_provider (
201- running_pipeline .get ('backend' ), running_pipeline .get ('kwargs' )
202- )
200+ backend_name = running_pipeline .get ('backend' )
201+ if backend_name == 'tpa-saml' :
202+ # Directly detect SAML backend to avoid registry lookup failures
203+ # (e.g. when pipeline kwargs lack response['idp_name'] at this point).
204+ saml_provider = True
205+ else :
206+ saml_provider , __ = third_party_auth .utils .is_saml_provider (
207+ backend_name , running_pipeline .get ('kwargs' )
208+ )
203209
204210 enterprise_customer = enterprise_customer_for_request (request )
205211
You can’t perform that action at this time.
0 commit comments