private ExternalIdPConfig processIdPConfigElement(OMElement idpConfigElem) { OMAttribute nameAttr = idpConfigElem.getAttribute(new QName("name")); // if the name is not given, do not register this config if (nameAttr == null) { log.warn("Each IDP configuration should have a unique name attribute"); return null; } // read the config parameters Map<String, String> parameterMap = new HashMap<>(); for (Iterator paramIterator = idpConfigElem.getChildrenWithLocalName("Parameter"); paramIterator.hasNext(); ) { OMElement paramElem = (OMElement) paramIterator.next(); OMAttribute paramNameAttr = paramElem.getAttribute(new QName("name")); if (paramNameAttr == null) { log.warn("A Parameter should have a name attribute. Skipping the parameter."); continue; } parameterMap.put(paramNameAttr.getAttributeValue(), paramElem.getText()); } IdentityProvider fedIdp = new IdentityProvider(); fedIdp.setIdentityProviderName(nameAttr.getAttributeValue()); ExternalIdPConfig externalIdPConfig = new ExternalIdPConfig(fedIdp); externalIdPConfig.setParameterMap(parameterMap); return externalIdPConfig; }
private ExternalIdPConfig processIdPConfigElement(OMElement idpConfigElem) { OMAttribute nameAttr = idpConfigElem.getAttribute(new QName("name")); // if the name is not given, do not register this config if (nameAttr == null) { log.warn("Each IDP configuration should have a unique name attribute"); return null; } // read the config parameters Map<String, String> parameterMap = new HashMap<>(); for (Iterator paramIterator = idpConfigElem.getChildrenWithLocalName("Parameter"); paramIterator.hasNext(); ) { OMElement paramElem = (OMElement) paramIterator.next(); OMAttribute paramNameAttr = paramElem.getAttribute(new QName("name")); if (paramNameAttr == null) { log.warn("A Parameter should have a name attribute. Skipping the parameter."); continue; } parameterMap.put(paramNameAttr.getAttributeValue(), paramElem.getText()); } IdentityProvider fedIdp = new IdentityProvider(); fedIdp.setIdentityProviderName(nameAttr.getAttributeValue()); ExternalIdPConfig externalIdPConfig = new ExternalIdPConfig(fedIdp); externalIdPConfig.setParameterMap(parameterMap); return externalIdPConfig; }
private ExternalIdPConfig processIdPConfigElement(OMElement idpConfigElem) { OMAttribute nameAttr = idpConfigElem.getAttribute(new QName("name")); // if the name is not given, do not register this config if (nameAttr == null) { log.warn("Each IDP configuration should have a unique name attribute"); return null; } // read the config parameters Map<String, String> parameterMap = new HashMap<>(); for (Iterator paramIterator = idpConfigElem.getChildrenWithLocalName("Parameter"); paramIterator.hasNext(); ) { OMElement paramElem = (OMElement) paramIterator.next(); OMAttribute paramNameAttr = paramElem.getAttribute(new QName("name")); if (paramNameAttr == null) { log.warn("A Parameter should have a name attribute. Skipping the parameter."); continue; } parameterMap.put(paramNameAttr.getAttributeValue(), paramElem.getText()); } IdentityProvider fedIdp = new IdentityProvider(); fedIdp.setIdentityProviderName(nameAttr.getAttributeValue()); ExternalIdPConfig externalIdPConfig = new ExternalIdPConfig(fedIdp); externalIdPConfig.setParameterMap(parameterMap); return externalIdPConfig; }
protected void loadLocalAuthenticators(AuthenticationStep authenticationStep, StepConfig stepConfig) { LocalAuthenticatorConfig[] localAuthenticators = authenticationStep.getLocalAuthenticatorConfigs(); if (localAuthenticators != null) { IdentityProvider localIdp = new IdentityProvider(); localIdp.setIdentityProviderName(FrameworkConstants.LOCAL_IDP_NAME); // assign it to the step for (LocalAuthenticatorConfig localAuthenticator : localAuthenticators) { String actualAuthenticatorName = localAuthenticator.getName(); loadStepAuthenticator(stepConfig, localIdp, actualAuthenticatorName); } } }
protected void loadLocalAuthenticators(AuthenticationStep authenticationStep, StepConfig stepConfig) { LocalAuthenticatorConfig[] localAuthenticators = authenticationStep.getLocalAuthenticatorConfigs(); if (localAuthenticators != null) { IdentityProvider localIdp = new IdentityProvider(); localIdp.setIdentityProviderName(FrameworkConstants.LOCAL_IDP_NAME); // assign it to the step for (LocalAuthenticatorConfig localAuthenticator : localAuthenticators) { String actualAuthenticatorName = localAuthenticator.getName(); loadStepAuthenticator(stepConfig, localIdp, actualAuthenticatorName); } } }
private void loadLocalAuthenticators(AuthenticationStep authenticationStep, StepConfig stepConfig) { LocalAuthenticatorConfig[] localAuthenticators = authenticationStep .getLocalAuthenticatorConfigs(); if (localAuthenticators != null) { IdentityProvider localIdp = new IdentityProvider(); localIdp.setIdentityProviderName(FrameworkConstants.LOCAL_IDP_NAME); // assign it to the step for (LocalAuthenticatorConfig localAuthenticator : localAuthenticators) { String actualAuthenticatorName = localAuthenticator.getName(); loadStepAuthenticator(stepConfig, localIdp, actualAuthenticatorName); } } }
private static void addSuperTenantIdp() throws Exception { try { IdentityProvider identityProvider = new IdentityProvider(); identityProvider.setIdentityProviderName(IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME); identityProvider.setHomeRealmId(IdentityUtil.getHostName()); identityProvider.setPrimary(true); IdentityProviderManager.getInstance() .addResidentIdP(identityProvider, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); } catch (Throwable e) { throw new Exception("Error when adding Resident Identity Provider entry for super tenant ", e); } } }
IdentityProvider fedIdp = null; fedIdp = new IdentityProvider(); fedIdp.setIdentityProviderName(resultSet.getString(1));
IdentityProvider fedIdp = null; fedIdp = new IdentityProvider(); fedIdp.setIdentityProviderName(resultSet.getString(1));
String idpName = idpEntry.getKey(); List<FederatedAuthenticatorConfig> fedAuthenticators = idpEntry.getValue(); IdentityProvider idp = new IdentityProvider(); idp.setIdentityProviderName(idpName); idp.setFederationHub(isFederationHubIdP(idpName, connection, tenantId));
public static IdentityProvider build(OMElement identityProviderOM) { IdentityProvider identityProvider = new IdentityProvider();
String idpName = idpEntry.getKey(); List<FederatedAuthenticatorConfig> fedAuthenticators = idpEntry.getValue(); IdentityProvider idp = new IdentityProvider(); idp.setIdentityProviderName(idpName); idp.setFederationHub(isFederationHubIdP(idpName, connection, tenantId));
rs = prepStmt.executeQuery(); while (rs.next()) { IdentityProvider identityProvider = new IdentityProvider(); identityProvider.setIdentityProviderName(rs.getString(1)); if ((IdPManagementConstants.IS_TRUE_VALUE).equals(rs.getString("IS_PRIMARY"))) {
public static IdentityProvider build(OMElement identityProviderOM) { IdentityProvider identityProvider = new IdentityProvider();
.getThreadLocalCarbonContext().getTenantDomain()); IdentityProvider identityProvider = new IdentityProvider(); identityProvider.setIdentityProviderName(idp.getIdentityProviderName());
.getThreadLocalCarbonContext().getTenantDomain()); IdentityProvider identityProvider = new IdentityProvider(); identityProvider.setIdentityProviderName(idp.getIdentityProviderName());
federatedIdp = new IdentityProvider();
federatedIdp = new IdentityProvider();
federatedIdp = new IdentityProvider(); federatedIdp.setIdentityProviderName(idPName);
/** * Add the default Resident Identity Provider entry when a new tenant is registered. * * @param tenantInfo Information about the newly created tenant */ @Override public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException { try { String tenantDomain = tenantInfo.getTenantDomain(); IdentityProvider identityProvider = new IdentityProvider(); identityProvider.setIdentityProviderName(IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME); identityProvider.setHomeRealmId("localhost"); identityProvider.setPrimary(true); IdentityProviderManager.getInstance().addResidentIdP(identityProvider, tenantDomain); } catch (IdentityProviderManagementException e) { String message = "Error when adding Resident Identity Provider entry for tenant " + tenantInfo.getTenantDomain(); throw new StratosException(message, e); } }