|
6 | 6 | from oracle.weblogic.deploy.exception import BundleAwareException
|
7 | 7 |
|
8 | 8 | from wlsdeploy.aliases.location_context import LocationContext
|
| 9 | +from wlsdeploy.aliases.model_constants import AUTHENTICATION_PROVIDER |
| 10 | +from wlsdeploy.aliases.model_constants import DEFAULT_AUTHENTICATOR |
| 11 | +from wlsdeploy.aliases.model_constants import DEFAULT_REALM |
| 12 | +from wlsdeploy.aliases.model_constants import PASSWORD_DIGEST_ENABLED |
9 | 13 | from wlsdeploy.aliases.model_constants import REALM
|
10 | 14 | from wlsdeploy.aliases.model_constants import SECURITY_CONFIGURATION
|
11 | 15 | from wlsdeploy.aliases.validation_codes import ValidationCodes
|
@@ -326,3 +330,48 @@ def _is_default_adjudicator_configuration(self, model_nodes):
|
326 | 330 |
|
327 | 331 | def is_adjudicator_changeable(self):
|
328 | 332 | return self._wls_helper.is_weblogic_version_or_above('12.2.1.4')
|
| 333 | + |
| 334 | + def is_default_authenticator_password_digest_enabled(self): |
| 335 | + _method_name = 'is_default_authenticator_password_digest_enabled' |
| 336 | + self.logger.entering(class_name=self.__class_name, method_name=_method_name) |
| 337 | + |
| 338 | + is_password_digest_enabled = False |
| 339 | + if self._topology: |
| 340 | + security_configuration = dictionary_utils.get_dictionary_element(self._topology, SECURITY_CONFIGURATION) |
| 341 | + realm = dictionary_utils.get_dictionary_element(security_configuration, REALM) |
| 342 | + realm_name = self.__get_default_realm_name() |
| 343 | + realm = dictionary_utils.get_dictionary_element(realm, realm_name) |
| 344 | + authenticators = dictionary_utils.get_dictionary_element(realm, AUTHENTICATION_PROVIDER) |
| 345 | + for atn_name, atn_dict in authenticators.iteritems(): |
| 346 | + if DEFAULT_AUTHENTICATOR in atn_dict: |
| 347 | + default_authenticator = atn_dict[DEFAULT_AUTHENTICATOR] |
| 348 | + is_password_digest_enabled = \ |
| 349 | + dictionary_utils.get_boolean_element(default_authenticator, PASSWORD_DIGEST_ENABLED) |
| 350 | + break |
| 351 | + |
| 352 | + self.logger.exiting(class_name=self.__class_name, method_name=_method_name, result=is_password_digest_enabled) |
| 353 | + return is_password_digest_enabled |
| 354 | + |
| 355 | + def __get_default_realm_name(self): |
| 356 | + _method_name = '__get_default_realm_name' |
| 357 | + self.logger.entering(class_name=self.__class_name, method_name=_method_name) |
| 358 | + |
| 359 | + location = LocationContext() |
| 360 | + name_token = self.aliases.get_name_token(location) |
| 361 | + location.add_name_token(name_token, self.model_context.get_domain_name()) |
| 362 | + security_configuration_wlst_path = self.aliases.get_wlst_attributes_path(location) |
| 363 | + |
| 364 | + pwd = self.wlst_helper.get_pwd() |
| 365 | + |
| 366 | + self.wlst_helper.cd(security_configuration_wlst_path) |
| 367 | + security_configuration = self.wlst_helper.lsa() |
| 368 | + default_realm_wlst_name = self.aliases.get_wlst_attribute_name(location, DEFAULT_REALM) |
| 369 | + if default_realm_wlst_name in security_configuration: |
| 370 | + default_realm_name = security_configuration[DEFAULT_REALM] |
| 371 | + else: |
| 372 | + default_realm_name = 'myrealm' |
| 373 | + |
| 374 | + self.wlst_helper.cd(pwd) |
| 375 | + |
| 376 | + self.logger.exiting(class_name=self.__class_name, method_name=_method_name, result=default_realm_name) |
| 377 | + return default_realm_name |
0 commit comments