gluu
公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService クラス
org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService の継承関係図
Inheritance graph
org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService 連携図
Collaboration graph

公開メンバ関数

List< CustomAuthenticationConfiguration > getCustomAuthenticationConfigurations ()
 

非公開メンバ関数

CustomAuthenticationConfiguration mapCustomAuthentication (oxIDPAuthConf oneConf)
 
Object jsonToObject (String json, Class<?> clazz) throws Exception
 

非公開変数類

Logger log
 
ApplianceService applianceService
 

静的非公開変数類

static final long serialVersionUID = -2225890597520443390L
 
static final String CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME = "script.__$__customAuthenticationScript__$__"
 
static final String CUSTOM_AUTHENTICATION_PROPERTY_PREFIX = "property."
 
static final String CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE = "usage."
 

詳解

Provides service methods methods with LDAP configuration

著者
Yuriy Movchan Date: 08.27.2012

関数詳解

◆ getCustomAuthenticationConfigurations()

List<CustomAuthenticationConfiguration> org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.getCustomAuthenticationConfigurations ( )
inline
48  {
49  GluuAppliance gluuAppliance = applianceService.getAppliance();
50  List<String> configurationJsons = gluuAppliance.getOxIDPAuthentication();
51 
52  List<CustomAuthenticationConfiguration> customAuthenticationConfigurations = new ArrayList<CustomAuthenticationConfiguration>();
53 
54  if (configurationJsons == null) {
55  return customAuthenticationConfigurations;
56  }
57 
58  for (String configurationJson : configurationJsons) {
59  oxIDPAuthConf configuration;
60  try {
61  configuration = (oxIDPAuthConf) jsonToObject(configurationJson, oxIDPAuthConf.class);
62  if (configuration.getEnabled() && configuration.getType().equalsIgnoreCase("customAuthentication")) {
63  CustomAuthenticationConfiguration customAuthenticationConfiguration = mapCustomAuthentication(configuration);
64  customAuthenticationConfigurations.add(customAuthenticationConfiguration);
65  }
66  } catch (Exception ex) {
67  log.error("Failed to create object by json: '{}'", configurationJson, ex);
68  }
69  }
70 
71  return customAuthenticationConfigurations;
72  }
GluuAppliance getAppliance()
Definition: ApplianceService.java:87
Object jsonToObject(String json, Class<?> clazz)
Definition: LdapCustomAuthenticationConfigurationService.java:112
Logger log
Definition: LdapCustomAuthenticationConfigurationService.java:43
CustomAuthenticationConfiguration mapCustomAuthentication(oxIDPAuthConf oneConf)
Definition: LdapCustomAuthenticationConfigurationService.java:74
List< String > getOxIDPAuthentication()
Definition: GluuAppliance.java:83
ApplianceService applianceService
Definition: LdapCustomAuthenticationConfigurationService.java:46

◆ jsonToObject()

Object org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.jsonToObject ( String  json,
Class<?>  clazz 
) throws Exception
inlineprivate
112  {
113  ObjectMapper mapper = new ObjectMapper();
114  Object clazzObject = mapper.readValue(json, clazz);
115  return clazzObject;
116  }

◆ mapCustomAuthentication()

CustomAuthenticationConfiguration org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.mapCustomAuthentication ( oxIDPAuthConf  oneConf)
inlineprivate
74  {
75  CustomAuthenticationConfiguration customAuthenticationConfig = new CustomAuthenticationConfiguration();
76  customAuthenticationConfig.setName(oneConf.getName());
77  customAuthenticationConfig.setLevel(oneConf.getLevel());
78  customAuthenticationConfig.setPriority(oneConf.getPriority());
79  customAuthenticationConfig.setEnabled(oneConf.getEnabled());
80  customAuthenticationConfig.setVersion(oneConf.getVersion());
81 
82  for (CustomProperty customProperty : oneConf.getFields()) {
83  if ((customProperty.getValues() == null) || (customProperty.getValues().size() == 0)) {
84  continue;
85  }
86 
87  String attrName = StringHelper.toLowerCase(customProperty.getName());
88 
89  if (StringHelper.isEmpty(attrName)) {
90  continue;
91  }
92 
93  String value = customProperty.getValues().get(0);
94 
95  if (attrName.startsWith(CUSTOM_AUTHENTICATION_PROPERTY_PREFIX)) {
96  String key = customProperty.getName().substring(CUSTOM_AUTHENTICATION_PROPERTY_PREFIX.length());
97  SimpleCustomProperty property = new SimpleCustomProperty(key, value);
98  customAuthenticationConfig.getCustomAuthenticationAttributes().add(property);
99  } else if (StringHelper.equalsIgnoreCase(attrName, CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME)) {
100  customAuthenticationConfig.setCustomAuthenticationScript(value);
101  } else if (StringHelper.equalsIgnoreCase(attrName, CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE)) {
102  if (StringHelper.isNotEmpty(value)) {
103  AuthenticationScriptUsageType authenticationScriptUsageType = AuthenticationScriptUsageType.getByValue(value);
104  customAuthenticationConfig.setUsageType(authenticationScriptUsageType);
105  }
106  }
107  }
108 
109  return customAuthenticationConfig;
110  }
static final String CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME
Definition: LdapCustomAuthenticationConfigurationService.java:38
static final String CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE
Definition: LdapCustomAuthenticationConfigurationService.java:40
static final String CUSTOM_AUTHENTICATION_PROPERTY_PREFIX
Definition: LdapCustomAuthenticationConfigurationService.java:39

メンバ詳解

◆ applianceService

ApplianceService org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.applianceService
private

◆ CUSTOM_AUTHENTICATION_PROPERTY_PREFIX

final String org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.CUSTOM_AUTHENTICATION_PROPERTY_PREFIX = "property."
staticprivate

◆ CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME

final String org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.CUSTOM_AUTHENTICATION_SCRIPT_PROPERTY_NAME = "script.__$__customAuthenticationScript__$__"
staticprivate

◆ CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE

final String org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.CUSTOM_AUTHENTICATION_SCRIPT_USAGE_TYPE = "usage."
staticprivate

◆ log

Logger org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.log
private

◆ serialVersionUID

final long org.xdi.oxauth.service.LdapCustomAuthenticationConfigurationService.serialVersionUID = -2225890597520443390L
staticprivate

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