gluu
公開メンバ関数 | 公開変数類 | 全メンバ一覧
BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication クラス
BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication の継承関係図
Inheritance graph
BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication 連携図
Collaboration graph

公開メンバ関数

def __init__ (self, currentTimeMillis)
 
def init (self, configurationAttributes)
 
def destroy (self, configurationAttributes)
 
def getApiVersion (self)
 
def isValidAuthenticationMethod (self, usageType, configurationAttributes)
 
def getAlternativeAuthenticationMethod (self, usageType, configurationAttributes)
 
def authenticate (self, configurationAttributes, requestParameters, step)
 
def prepareForStep (self, configurationAttributes, requestParameters, step)
 
def getExtraParametersForStep (self, configurationAttributes, step)
 
def getCountAuthenticationSteps (self, configurationAttributes)
 
def getPageForStep (self, configurationAttributes, step)
 
def logout (self, configurationAttributes, requestParameters)
 

公開変数類

 currentTimeMillis
 

詳解

構築子と解体子

◆ __init__()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.__init__ (   self,
  currentTimeMillis 
)
17  def __init__(self, currentTimeMillis):
18  self.currentTimeMillis = currentTimeMillis
19 

関数詳解

◆ authenticate()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.authenticate (   self,
  configurationAttributes,
  requestParameters,
  step 
)
39  def authenticate(self, configurationAttributes, requestParameters, step):
40  userService = CdiUtil.bean(UserService)
41  authenticationService = CdiUtil.bean(AuthenticationService)
42 
43  identity = CdiUtil.bean(Identity)
44  credentials = identity.getCredentials()
45  user_name = credentials.getUsername()
46 
47  if (step == 1):
48  print "Basic (with password update). Authenticate for step 1"
49 
50  user_password = credentials.getPassword()
51 
52  logged_in = False
53  if (StringHelper.isNotEmptyString(user_name) and StringHelper.isNotEmptyString(user_password)):
54  logged_in = authenticationService.authenticate(user_name, user_password)
55 
56  if (not logged_in):
57  return False
58 
59  return True
60  elif (step == 2):
61  print "Basic (with password update). Authenticate for step 2"
62  user = authenticationService.getAuthenticatedUser()
63  if user == None:
64  print "Basic (with password update). Authenticate for step 2. Failed to determine user name"
65  return False
66 
67  user_name = user.getUserId()
68  find_user_by_uid = userService.getUser(user_name)
69 
70  update_button = requestParameters.get("loginForm:updateButton")
71 
72  if ArrayHelper.isEmpty(update_button):
73  return True
74 
75  new_password_array = requestParameters.get("new_password")
76  if ArrayHelper.isEmpty(new_password_array) or StringHelper.isEmpty(new_password_array[0]):
77  print "Basic (with password update). Authenticate for step 2. New password is empty"
78  return False
79 
80  new_password = new_password_array[0]
81  find_user_by_uid.setAttribute("userPassword", new_password)
82  print "Basic (with password update). Authenticate for step 2. Attempting to set new user '%s' password" % user_name
83 
84  userService.updateUser(find_user_by_uid)
85  print "Basic (with password update). Authenticate for step 2. Password updated successfully"
86 
87  return True
88  else:
89  return False
90 

◆ destroy()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.destroy (   self,
  configurationAttributes 
)
25  def destroy(self, configurationAttributes):
26  print "Basic (with password update). Destroy"
27  print "Basic (with password update). Destroyed successfully"
28  return True
29 

◆ getAlternativeAuthenticationMethod()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.getAlternativeAuthenticationMethod (   self,
  usageType,
  configurationAttributes 
)
36  def getAlternativeAuthenticationMethod(self, usageType, configurationAttributes):
37  return None
38 

◆ getApiVersion()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.getApiVersion (   self)
30  def getApiVersion(self):
31  return 1
32 

◆ getCountAuthenticationSteps()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.getCountAuthenticationSteps (   self,
  configurationAttributes 
)
104  def getCountAuthenticationSteps(self, configurationAttributes):
105  return 2
106 

◆ getExtraParametersForStep()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.getExtraParametersForStep (   self,
  configurationAttributes,
  step 
)
101  def getExtraParametersForStep(self, configurationAttributes, step):
102  return None
103 

◆ getPageForStep()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.getPageForStep (   self,
  configurationAttributes,
  step 
)
107  def getPageForStep(self, configurationAttributes, step):
108  if (step == 2):
109  return "/auth/pwd/newpassword.xhtml"
110 
111  return ""
112 

◆ init()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.init (   self,
  configurationAttributes 
)
20  def init(self, configurationAttributes):
21  print "Basic (with password update). Initialization"
22  print "Basic (with password update). Initialized successfully"
23  return True
24 

◆ isValidAuthenticationMethod()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.isValidAuthenticationMethod (   self,
  usageType,
  configurationAttributes 
)
33  def isValidAuthenticationMethod(self, usageType, configurationAttributes):
34  return True
35 

◆ logout()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.logout (   self,
  configurationAttributes,
  requestParameters 
)
113  def logout(self, configurationAttributes, requestParameters):
114  return True
115 

◆ prepareForStep()

def BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.prepareForStep (   self,
  configurationAttributes,
  requestParameters,
  step 
)
91  def prepareForStep(self, configurationAttributes, requestParameters, step):
92  if (step == 1):
93  print "Basic (with password update). Prepare for Step 1"
94  return True
95  elif (step == 2):
96  print "Basic (with password update). Prepare for Step 2"
97  return True
98  else:
99  return False
100 

メンバ詳解

◆ currentTimeMillis

BasicPassowrdUpdateExternalAuthenticator.PersonAuthentication.currentTimeMillis

このクラス詳解は次のファイルから抽出されました: