policyIds = list.toArray(new String[list.size()]); String version = resource.getProperty("version"); if (version != null) { this.version = version; String action = resource.getProperty("action"); if (action != null) { this.action = action; String order = resource.getProperty("order"); if (order != null) { this.order = Integer.parseInt(order);
private UIPermissionNode getUIPermissionNode(Resource resource, boolean isSelected) throws RegistryException { String displayName = resource.getProperty(UserMgtConstants.DISPLAY_NAME); return new UIPermissionNode(resource.getPath(), displayName, isSelected); }
private UIPermissionNode getUIPermissionNode(Resource resource, boolean isSelected) throws RegistryException { String displayName = resource.getProperty(UserMgtConstants.DISPLAY_NAME); return new UIPermissionNode(resource.getPath(), displayName, isSelected); }
policyIds = list.toArray(new String[list.size()]); String version = resource.getProperty("version"); if (version != null) { this.version = version; String action = resource.getProperty("action"); if (action != null) { this.action = action; String order = resource.getProperty("order"); if (order != null) { this.order = Integer.parseInt(order);
/** * Check if resource has expired and delete. * * @param registry Registry instance to use. * @param resourcePath Path of resource to be deleted. * @throws RegistryException */ private static void checkAndDeleteRegistryResource (Registry registry, String resourcePath) throws RegistryException { Resource resource = registry.get(resourcePath); long currentEpochTime = System.currentTimeMillis(); long resourceExpireTime = Long.parseLong(resource.getProperty(EXPIRE_TIME_PROPERTY)); if (currentEpochTime > resourceExpireTime) { registry.delete(resource.getId()); } }
policyIds = list.toArray(new String[list.size()]); String version = resource.getProperty("version"); if (version != null) { this.version = version; String action = resource.getProperty("action"); if (action != null) { this.action = action; String order = resource.getProperty("order"); if (order != null) { this.order = Integer.parseInt(order);
/** * Check if resource has expired and delete. * * @param registry Registry instance to use. * @param resourcePath Path of resource to be deleted. * @throws RegistryException */ private static void checkAndDeleteRegistryResource (Registry registry, String resourcePath) throws RegistryException { Resource resource = registry.get(resourcePath); long currentEpochTime = System.currentTimeMillis(); long resourceExpireTime = Long.parseLong(resource.getProperty(EXPIRE_TIME_PROPERTY)); if (currentEpochTime > resourceExpireTime) { registry.delete(resource.getId()); } }
Resource resource = registry.get(resourcePath); ClaimDTO claimDTO = new ClaimDTO(); claimDTO.setRealm(resource.getProperty(REALM_NAME).replace(SLASH_REPLACE_CHARACTER, "/")); String claims = resource.getProperty(CLAIMS); if (claims.startsWith("[")) { claims = claims.replaceFirst("\\[", ""); claimDTO.setClaimDialect(resource.getProperty(CLAIM_DIALECT));
Resource resource = registry.get(resourcePath); ClaimDTO claimDTO = new ClaimDTO(); claimDTO.setRealm(resource.getProperty(REALM_NAME).replace(SLASH_REPLACE_CHARACTER, "/")); String claims = resource.getProperty(CLAIMS); if (claims.startsWith("[")) { claims = claims.replaceFirst("\\[", ""); claimDTO.setClaimDialect(resource.getProperty(CLAIM_DIALECT));
String supportedScope = (String) supporetdScopes.nextElement(); if (supportedScope.equals(requestedScope)) { requestedScopeClaims = resource.getProperty(requestedScope); if (requestedScopeClaims.contains(",")) { arrRequestedScopeClaims = requestedScopeClaims.split(",");
ClaimDTO claimDTO = new ClaimDTO(); claimDTO.setRealm(realmName.replace(SLASH_REPLACE_CHARACTER, "/")); String claims = resource.getProperty(CLAIMS); claimDTO.setClaimDialect(resource.getProperty(CLAIM_DIALECT)); return claimDTO; } catch (RegistryException e) {
ClaimDTO claimDTO = new ClaimDTO(); claimDTO.setRealm(realmName.replace(SLASH_REPLACE_CHARACTER, "/")); String claims = resource.getProperty(CLAIMS); claimDTO.setClaimDialect(resource.getProperty(CLAIM_DIALECT)); return claimDTO; } catch (RegistryException e) {
private Properties getOIDCScopeProperties(String spTenantDomain) { Resource oidcScopesResource = null; try { int tenantId = IdentityTenantUtil.getTenantId(spTenantDomain); startTenantFlow(spTenantDomain, tenantId); RegistryService registryService = OAuth2ServiceComponentHolder.getRegistryService(); if (registryService == null) { throw new RegistryException("Registry Service not set in OAuth2 Component. Component may not have " + "initialized correctly."); } oidcScopesResource = registryService.getConfigSystemRegistry(tenantId).get(SCOPE_RESOURCE_PATH); } catch (RegistryException e) { log.error("Error while obtaining registry collection from registry path:" + SCOPE_RESOURCE_PATH, e); } finally { PrivilegedCarbonContext.endTenantFlow(); } Properties propertiesToReturn = new Properties(); if (oidcScopesResource != null) { for (Object scopeProperty : oidcScopesResource.getProperties().keySet()) { String propertyKey = (String) scopeProperty; propertiesToReturn.setProperty(propertyKey, oidcScopesResource.getProperty(propertyKey)); } } else { log.error("OIDC scope resource cannot be found at " + SCOPE_RESOURCE_PATH + " for tenantDomain: " + spTenantDomain); } return propertiesToReturn; }
if (registry.resourceExists(uiPermission.getResourceId())) { Resource existingResource = registry.get(uiPermission.getResourceId()); if (existingResource.getProperty(UserMgtConstants.DISPLAY_NAME) == null) { existingResource.setProperty(UserMgtConstants.DISPLAY_NAME, uiPermission.getDisplayName()); registry.put(uiPermission.getResourceId(), existingResource);