本文整理汇总了Java中org.wso2.carbon.user.core.UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME属性的具体用法?Java UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME怎么用?Java UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wso2.carbon.user.core.UserCoreConstants
的用法示例。
在下文中一共展示了UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doPreDeleteUser
/**
* Delete federated user account associations a user has upon deleting the local user account.
*
* @param userName
* @param userStoreManager
* @return
* @throws UserStoreException
*/
@Override
public boolean doPreDeleteUser(String userName,
UserStoreManager userStoreManager) throws UserStoreException {
if (!isEnable()) {
return true;
}
String userStoreDomain = UserCoreUtil.getDomainName(userStoreManager.getRealmConfiguration());
if (StringUtils.isBlank(userStoreDomain)) {
userStoreDomain = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
int tenantId = userStoreManager.getTenantId();
if (log.isDebugEnabled()) {
log.debug("doPreDeleteUser method executed in ProfileMgtEventListener for user:" +
getFullQualifiedUsername(userName, userStoreDomain, IdentityTenantUtil.getTenantDomain(tenantId)));
}
deleteFederatedIdpAccountAssociations(userName, userStoreDomain, tenantId);
return true;
}
示例2: getDomainFromName
private String getDomainFromName(String name) {
int index;
if ((index = name.indexOf("/")) > 0) {
String domain = name.substring(0, index);
return domain;
}
return UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
示例3: getDomainFromUserName
private String getDomainFromUserName(String username) {
int index;
String domain = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
if (StringUtils.isNotBlank(username)) {
if ((index = username.indexOf("/")) > 0) {
domain = username.substring(0, index);
}
return domain;
}
return domain;
}
示例4: getPrimaryDomainName
public static String getPrimaryDomainName() {
RealmConfiguration realmConfiguration = IdentityTenantUtil.getRealmService().getBootstrapRealmConfiguration();
if (realmConfiguration.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME) != null) {
return realmConfiguration.getUserStoreProperty(
UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME).toUpperCase();
} else {
return UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
}
示例5: getUserStoreDomainName
public static String getUserStoreDomainName(String userName) {
int index;
String userDomain;
if ((index = userName.indexOf(CarbonConstants.DOMAIN_SEPARATOR)) >= 0) {
// remove domain name if exist
userDomain = userName.substring(0, index);
} else {
userDomain = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
return userDomain;
}
示例6: doPreSetUserClaimValues
@Override
public boolean doPreSetUserClaimValues(String userName, Map<String, String> claims, String profileName,
UserStoreManager userStoreManager) throws UserStoreException {
if (!isEnable()) {
return true;
}
if (log.isDebugEnabled()) {
String userStoreDomain = UserCoreUtil.getDomainName(userStoreManager.getRealmConfiguration());
if (StringUtils.isBlank(userStoreDomain)) {
userStoreDomain = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
String tenantDomain = IdentityTenantUtil.getTenantDomain(userStoreManager.getTenantId());
log.debug("doPreSetUserClaimValues method executed in ProfileMgtEventListener for user: " +
getFullQualifiedUsername(userName, userStoreDomain, tenantDomain));
}
//The following black listed patterns contain possible invalid inputs for profile which could be used for a
// stored XSS attack.
String[] whiteListPatternKeys = {ALPHANUMERICS_ONLY, DIGITS_ONLY};
String[] blackListPatternKeys = {WHITESPACE_EXISTS, URI_RESERVED_EXISTS, HTML_META_EXISTS, XML_META_EXISTS,
REGEX_META_EXISTS, URL};
if (!IdentityValidationUtil.isValid(profileName, whiteListPatternKeys, blackListPatternKeys)) {
throw new UserStoreException("profile name contains invalid characters!");
}
return true;
}
示例7: getDomainName
public static String getDomainName(String username) {
int index = username.indexOf(CarbonConstants.DOMAIN_SEPARATOR);
if (index < 0) {
return UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
return username.substring(0, index);
}
示例8: getPrimaryDomainName
public static String getPrimaryDomainName() {
RealmConfiguration realmConfiguration = IdentityTenantUtil.getRealmService().getBootstrapRealmConfiguration();
if(realmConfiguration.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME) != null){
return realmConfiguration.getUserStoreProperty(
UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME).toUpperCase();
} else {
return UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME;
}
}
示例9: getGroupNameWithDomain
public static String getGroupNameWithDomain(String groupName) {
if (groupName == null) {
return groupName;
}
if (groupName.indexOf(CarbonConstants.DOMAIN_SEPARATOR) > 0) {
return groupName;
} else {
return UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME
+ CarbonConstants.DOMAIN_SEPARATOR + groupName;
}
}
示例10: setUpLocalClaims
private void setUpLocalClaims() {
String localClaimURI1 = "testLocalClaimURI1";
String localClaimURI2 = "testLocalClaimURI2";
{
localClaim1 = new LocalClaim(localClaimURI1);
AttributeMapping attributeMapping1 = new AttributeMapping(UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME,
"uid");
AttributeMapping attributeMapping2 = new AttributeMapping("AD", "sAMAccountName");
List<AttributeMapping> attributeMappingList = new ArrayList<>();
attributeMappingList.add(attributeMapping1);
attributeMappingList.add(attributeMapping2);
Map<String, String> claimPropertiesMap = new HashMap<>();
claimPropertiesMap.put(ClaimConstants.DISPLAY_NAME_PROPERTY, "username");
claimPropertiesMap.put(ClaimConstants.READ_ONLY_PROPERTY, "true");
localClaim2 = new LocalClaim(localClaimURI2, attributeMappingList, claimPropertiesMap);
localClaims = new LocalClaim[]{localClaim1, localClaim2};
}
{
localClaimDTO1 = new LocalClaimDTO();
localClaimDTO1.setLocalClaimURI(localClaimURI1);
AttributeMappingDTO attributeMappingDTO1 = new AttributeMappingDTO();
attributeMappingDTO1.setUserStoreDomain(UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME);
attributeMappingDTO1.setAttributeName("uid");
AttributeMappingDTO attributeMappingDTO2 = new AttributeMappingDTO();
attributeMappingDTO2.setUserStoreDomain("AD");
attributeMappingDTO2.setAttributeName("sAMAccountName");
AttributeMappingDTO[] attributeMappingDTOs = new AttributeMappingDTO[]{attributeMappingDTO1,
attributeMappingDTO2};
ClaimPropertyDTO claimPropertyDTO1 = new ClaimPropertyDTO();
claimPropertyDTO1.setPropertyName(ClaimConstants.DISPLAY_NAME_PROPERTY);
claimPropertyDTO1.setPropertyValue("username");
ClaimPropertyDTO claimPropertyDTO2 = new ClaimPropertyDTO();
claimPropertyDTO2.setPropertyName(ClaimConstants.READ_ONLY_PROPERTY);
claimPropertyDTO2.setPropertyValue("true");
ClaimPropertyDTO[] claimPropertyDTOs = new ClaimPropertyDTO[]{claimPropertyDTO1, claimPropertyDTO2};
localClaimDTO2 = new LocalClaimDTO();
localClaimDTO2.setLocalClaimURI(localClaimURI2);
localClaimDTO2.setAttributeMappings(attributeMappingDTOs);
localClaimDTO2.setClaimProperties(claimPropertyDTOs);
localClaimDTOs = new LocalClaimDTO[]{localClaimDTO1, localClaimDTO2};
}
}
示例11: credentials
@DataProvider(name = "Authentication")
public Object[][] credentials() {
String localClaimURI3 = "testLocalClaimURI3";
AttributeMapping attributeMapping1 = new AttributeMapping(UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME,
"uid");
AttributeMapping attributeMapping2 = new AttributeMapping("AD", "sAMAccountName");
List<AttributeMapping> attributeMappingList = new ArrayList<>();
attributeMappingList.add(attributeMapping1);
attributeMappingList.add(attributeMapping2);
Map<String, String> claimPropertiesMap = new HashMap<>();
claimPropertiesMap.put(ClaimConstants.DISPLAY_NAME_PROPERTY, "username");
claimPropertiesMap.put(ClaimConstants.DESCRIPTION_PROPERTY, "Username of the system");
claimPropertiesMap.put(ClaimConstants.REGULAR_EXPRESSION_PROPERTY, "^[\\S]{5,30}$");
claimPropertiesMap.put(ClaimConstants.DISPLAY_ORDER_PROPERTY, "1");
claimPropertiesMap.put(ClaimConstants.SUPPORTED_BY_DEFAULT_PROPERTY, "true");
claimPropertiesMap.put(ClaimConstants.REQUIRED_PROPERTY, "true");
claimPropertiesMap.put(ClaimConstants.READ_ONLY_PROPERTY, "true");
claimPropertiesMap.put(ClaimConstants.DEFAULT_ATTRIBUTE, "uid");
LocalClaim localClaim3 = new LocalClaim(localClaimURI3, attributeMappingList, claimPropertiesMap);
String localClaimURI4 = "testLocalClaimURI4";
Map<String, String> claimPropertiesMap2 = new HashMap<>();
claimPropertiesMap2.put(ClaimConstants.DISPLAY_NAME_PROPERTY, "username");
claimPropertiesMap2.put(ClaimConstants.DESCRIPTION_PROPERTY, "Username of the system");
claimPropertiesMap2.put(ClaimConstants.REGULAR_EXPRESSION_PROPERTY, "^[\\S]{5,30}$");
claimPropertiesMap2.put(ClaimConstants.DISPLAY_ORDER_PROPERTY, "1");
claimPropertiesMap2.put(ClaimConstants.SUPPORTED_BY_DEFAULT_PROPERTY, "false");
claimPropertiesMap2.put(ClaimConstants.REQUIRED_PROPERTY, "false");
claimPropertiesMap2.put(ClaimConstants.READ_ONLY_PROPERTY, "false");
claimPropertiesMap2.put(ClaimConstants.DEFAULT_ATTRIBUTE, "uid");
LocalClaim localClaim4 = new LocalClaim(localClaimURI4, attributeMappingList, claimPropertiesMap2);
return new Object[][] {{localClaim1}, {localClaim2}, {localClaim3}, {localClaim4}};
}