Search in sources :

Example 1 with BaseConfigType

use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.

the class WSFedPropertiesModelImpl method getspsso.

/**
     * Retrieves the SPSSOConfigElement.
     *
     * @param fed is the FederationConfigElement.
     * @return the corresponding SPSSOConfigType Object.
     */
private SPSSOConfigElement getspsso(FederationConfigElement fed) {
    List listFed = fed.getIDPSSOConfigOrSPSSOConfig();
    SPSSOConfigElement spsso = null;
    Iterator i = listFed.iterator();
    //SPSSOConfigElement ?????
    while (i.hasNext()) {
        BaseConfigType bc = (BaseConfigType) i.next();
        if (bc instanceof SPSSOConfigElement) {
            spsso = (SPSSOConfigElement) bc;
            break;
        }
    }
    return spsso;
}
Also used : BaseConfigType(com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType) SPSSOConfigElement(com.sun.identity.wsfederation.jaxb.entityconfig.SPSSOConfigElement) Iterator(java.util.Iterator) List(java.util.List)

Example 2 with BaseConfigType

use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.

the class WSFedPropertiesModelImpl method getidpsso.

/**
     * Retrieves the IDPSSOConfigElement .
     *
     * @param fed is the FederationConfigElement.
     * @return the corresponding IDPSSOConfigType Object.
     */
private IDPSSOConfigElement getidpsso(FederationConfigElement fed) {
    List listFed = fed.getIDPSSOConfigOrSPSSOConfig();
    IDPSSOConfigElement idpsso = null;
    Iterator i = listFed.iterator();
    //IDPSSOConfigElement ?????
    while (i.hasNext()) {
        BaseConfigType bc = (BaseConfigType) i.next();
        if (bc instanceof IDPSSOConfigElement) {
            idpsso = (IDPSSOConfigElement) bc;
            break;
        }
    }
    return idpsso;
}
Also used : BaseConfigType(com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType) Iterator(java.util.Iterator) List(java.util.List) IDPSSOConfigElement(com.sun.identity.wsfederation.jaxb.entityconfig.IDPSSOConfigElement)

Example 3 with BaseConfigType

use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.

the class WSFedPropertiesModelImpl method setSPExtAttributeValues.

/**
     * Saves the extended metadata attribute values for the SP.
     *
     * @param realm to which the entity belongs.
     * @param fedId is the entity id.
     * @param spExtvalues has the extended attribute value pairs of SP.
     * @param location has the information whether remote or hosted.
     * @throws AMConsoleException if saving of attribute value fails.
     */
public void setSPExtAttributeValues(String realm, String fedId, Map spExtvalues, String location) throws AMConsoleException {
    try {
        String role = EntityModel.SERVICE_PROVIDER;
        //fed is the extended entity configuration object under the realm
        WSFederationMetaManager metaManager = getWSFederationMetaManager();
        FederationConfigElement fed = metaManager.getEntityConfig(realm, fedId);
        if (fed == null) {
            SPEX_DATA_MAP.put(TF_DISPNAME, Collections.EMPTY_SET);
            createExtendedObject(realm, fedId, location, SERVICE_PROVIDER, SPEX_DATA_MAP);
            fed = metaManager.getEntityConfig(realm, fedId);
        }
        SPSSOConfigElement spsso = getspsso(fed);
        if (spsso != null) {
            BaseConfigType baseConfig = (BaseConfigType) spsso;
            updateBaseConfig(baseConfig, spExtvalues, role);
        }
        //saves the attributes by passing the new fed object
        metaManager.setEntityConfig(realm, fed);
    } catch (JAXBException e) {
        debug.warning("WSFedPropertiesModelImpl.setSPExtAttributeValues", e);
        throw new AMConsoleException(e.getMessage());
    } catch (WSFederationMetaException e) {
        debug.warning("WSFedPropertiesModelImpl.setSPExtAttributeValues", e);
        throw new AMConsoleException(e.getMessage());
    }
}
Also used : BaseConfigType(com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType) WSFederationMetaManager(com.sun.identity.wsfederation.meta.WSFederationMetaManager) JAXBException(javax.xml.bind.JAXBException) SPSSOConfigElement(com.sun.identity.wsfederation.jaxb.entityconfig.SPSSOConfigElement) FederationConfigElement(com.sun.identity.wsfederation.jaxb.entityconfig.FederationConfigElement) WSFederationMetaException(com.sun.identity.wsfederation.meta.WSFederationMetaException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 4 with BaseConfigType

use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.

the class WSFederationMetaManager method getEntityByMetaAlias.

/**
     * Returns entity ID associated with the metaAlias.
     * 
     * @param metaAlias The metaAlias.
     * @return entity ID associated with the metaAlias or null if not found.
     * @throws WSFederationMetaException if unable to retrieve the entity ids.
     */
public String getEntityByMetaAlias(String metaAlias) throws WSFederationMetaException {
    String realm = WSFederationMetaUtils.getRealmByMetaAlias(metaAlias);
    try {
        Set entityIds = configInst.getAllConfigurationNames(realm);
        if (entityIds == null || entityIds.isEmpty()) {
            return null;
        }
        for (Iterator iter = entityIds.iterator(); iter.hasNext(); ) {
            String federationId = (String) iter.next();
            FederationConfigElement config = getEntityConfig(realm, federationId);
            if (config == null) {
                continue;
            }
            List list = config.getIDPSSOConfigOrSPSSOConfig();
            for (Iterator iter2 = list.iterator(); iter2.hasNext(); ) {
                BaseConfigType bConfig = (BaseConfigType) iter2.next();
                String cMetaAlias = bConfig.getMetaAlias();
                if (cMetaAlias != null && cMetaAlias.equals(metaAlias)) {
                    return federationId;
                }
            }
        }
    } catch (ConfigurationException e) {
        debug.error("WSFederationMetaManager.getEntityByMetaAlias:", e);
        throw new WSFederationMetaException(e);
    }
    return null;
}
Also used : BaseConfigType(com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType) HashSet(java.util.HashSet) Set(java.util.Set) ConfigurationException(com.sun.identity.plugin.configuration.ConfigurationException) Iterator(java.util.Iterator) FederationConfigElement(com.sun.identity.wsfederation.jaxb.entityconfig.FederationConfigElement) ArrayList(java.util.ArrayList) List(java.util.List)

Example 5 with BaseConfigType

use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.

the class ValidWReplyExtractor method extractValidDomains.

@Override
public Collection<String> extractValidDomains(final WSFederationEntityInfo entityInfo) {
    try {
        BaseConfigType config;
        final Map<String, List<String>> attrs;
        if (SAML2Constants.SP_ROLE.equalsIgnoreCase(entityInfo.role)) {
            config = WSFederationUtils.getMetaManager().getSPSSOConfig(entityInfo.realm, entityInfo.entityID);
        } else {
            config = WSFederationUtils.getMetaManager().getIDPSSOConfig(entityInfo.realm, entityInfo.entityID);
        }
        if (config == null) {
            DEBUG.warning("ValidWReplyExtractor.getValidDomains: Entity config is null for entityInfo: " + entityInfo);
            return null;
        }
        attrs = WSFederationMetaUtils.getAttributes(config);
        if (attrs == null) {
            DEBUG.warning("ValidWReplyExtractor.getValidDomains: Cannot find extended attributes");
            return null;
        }
        final List<String> values = attrs.get(WSFederationConstants.WREPLY_URL_LIST);
        if (values != null && !values.isEmpty()) {
            return values;
        }
    } catch (final WSFederationMetaException sme) {
        DEBUG.warning("Unable to retrieve extended configuration", sme);
    }
    return null;
}
Also used : BaseConfigType(com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType) List(java.util.List) WSFederationMetaException(com.sun.identity.wsfederation.meta.WSFederationMetaException)

Aggregations

BaseConfigType (com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType)13 List (java.util.List)9 FederationConfigElement (com.sun.identity.wsfederation.jaxb.entityconfig.FederationConfigElement)7 WSFederationMetaException (com.sun.identity.wsfederation.meta.WSFederationMetaException)6 Iterator (java.util.Iterator)6 FederationElement (com.sun.identity.wsfederation.jaxb.wsfederation.FederationElement)4 WSFederationMetaManager (com.sun.identity.wsfederation.meta.WSFederationMetaManager)4 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 JAXBException (javax.xml.bind.JAXBException)3 ConfigurationException (com.sun.identity.plugin.configuration.ConfigurationException)2 WSFederationException (com.sun.identity.wsfederation.common.WSFederationException)2 AttributeType (com.sun.identity.wsfederation.jaxb.entityconfig.AttributeType)2 IDPSSOConfigElement (com.sun.identity.wsfederation.jaxb.entityconfig.IDPSSOConfigElement)2 ObjectFactory (com.sun.identity.wsfederation.jaxb.entityconfig.ObjectFactory)2 SPSSOConfigElement (com.sun.identity.wsfederation.jaxb.entityconfig.SPSSOConfigElement)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 SessionException (com.sun.identity.plugin.session.SessionException)1 HashSet (java.util.HashSet)1