Skip to content

Commit

Permalink
refactor(SamlPassportScripts): add sonalcloud code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdhttps committed Jan 6, 2022
1 parent 21e3a32 commit a98f467
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
print "Passport. prepareForStep called %s" % str(step)
identity = CdiUtil.bean(Identity)

facesContext = CdiUtil.bean(FacesContext)
requestParameters = facesContext.getExternalContext().getRequestParameterMap()
faces_context = CdiUtil.bean(FacesContext)
request_parameters = faces_context.getExternalContext().getRequestParameterMap()

passportStrategyFailed = None
passport_strategy_failed = None
try:
passportStrategyFailed = requestParameters['failure']
print "Passport. failure return from passport: %s, Check Passport logs " % passportStrategyFailed
except:
passport_strategy_failed = request_parameters['failure']
print("Passport. failure return from passport: %s, Check Passport logs " % passport_strategy_failed)
except Exception as e:
pass

if step == 1:
Expand Down Expand Up @@ -203,8 +203,8 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
print "Passport. prepareForStep. A provider value could not be extracted from custom authorization request parameter"
elif not provider in self.registeredProviders:
print "Passport. prepareForStep. Provider '%s' not part of known configured IDPs/OPs" % provider
elif passportStrategyFailed != None:
print "Passport. passport strategy failed : %s, Check Passport logs" % passportStrategyFailed
elif passport_strategy_failed != None:
print("Passport. passport strategy failed : %s, Check Passport logs" % passport_strategy_failed)
else:
url = self.getPassportRedirectUrl(provider)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
print "Passport. prepareForStep called %s" % str(step)
identity = CdiUtil.bean(Identity)

facesContext = CdiUtil.bean(FacesContext)
requestParameters = facesContext.getExternalContext().getRequestParameterMap()
faces_context = CdiUtil.bean(FacesContext)
request_parameters = faces_context.getExternalContext().getRequestParameterMap()

passportStrategyFailed = None
passport_strategy_failed = None
try:
passportStrategyFailed = requestParameters['failure']
print "Passport. failure return from passport: %s, Check Passport logs " % passportStrategyFailed
except:
passport_strategy_failed = request_parameters['failure']
print("Passport. failure return from passport: %s, Check Passport logs " % passport_strategy_failed)
except Exception as e:
pass

if step == 1:
Expand Down Expand Up @@ -250,8 +250,8 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
print "Passport. prepareForStep. A provider value could not be extracted from custom authorization request parameter"
elif not provider in self.registeredProviders:
print "Passport. prepareForStep. Provider '%s' not part of known configured IDPs/OPs" % provider
elif passportStrategyFailed != None:
print "Passport. passport strategy failed : %s, Check Passport logs" % passportStrategyFailed
elif passport_strategy_failed != None:
print("Passport. passport strategy failed : %s, Check Passport logs" % passport_strategy_failed)
else:
url = self.getPassportRedirectUrl(provider)

Expand Down

0 comments on commit a98f467

Please sign in to comment.