Search in sources :

Example 41 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class SAMLv2AuthnAuthorityViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        //retrieve the standard metadata values from the property sheet
        Map authnAuthValues = ps.getAttributeValues(model.getStandardAuthnAuthorityAttributes(realm, entityName), false, model);
        //save the standard metadata values for attribute authority
        model.setStdAuthnAuthorityValues(realm, entityName, authnAuthValues);
        //retrieve the extended metadata values from the property sheet
        Map authnAuthExtValues = ps.getAttributeValues(model.getauthnAuthEXDataMap(), false, model);
        //save the extended metadata values for attribute authority
        model.setExtauthnAuthValues(realm, entityName, authnAuthExtValues, location);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "samlv2.authnauth.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model) HashMap(java.util.HashMap) Map(java.util.Map)

Example 42 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class SAMLv2IDPAdvancedViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
    ps.init();
    SAMLv2Model model = (SAMLv2Model) getModel();
    //no attributes to show from std
    //get extended attributes
    ps.setAttributeValues(getExtendedValues(), model);
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model)

Example 43 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class SAMLv2IDPAssertionContentViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        //retrieve the standard metadata values from the property sheet
        Map idpStdValues = ps.getAttributeValues(model.getStandardIdentityProviderAttributes(realm, entityName), false, model);
        //retrieve the extended metadata values from the property sheet
        Map idpExtValues = getExtendedValues();
        Map new_idpExtValues = ps.getAttributeValues(model.getIDPEXACDataMap(), false, model);
        // password fields are set to AMPropertySheetModel.passwordRandom before they are displayed to the user.
        if (new_idpExtValues.containsKey(SAMLv2Model.IDP_SIGN_CERT_KEYPASS)) {
            Set value = (Set) new_idpExtValues.get(SAMLv2Model.IDP_SIGN_CERT_KEYPASS);
            if (value != null && !value.isEmpty()) {
                String keyPass = (String) value.iterator().next();
                if (AMPropertySheetModel.passwordRandom.equals(keyPass)) {
                    // User did not change the password => remove fake value to avoid it overriding the stored value
                    new_idpExtValues.remove(SAMLv2Model.IDP_SIGN_CERT_KEYPASS);
                } else {
                    // The value has been updated
                    Set<String> encodedValue = new HashSet<String>(1);
                    // If the value is blank, don't encode
                    if (keyPass.isEmpty()) {
                        encodedValue.add(keyPass);
                    } else {
                        //Since it is plain text we need to encrypt it before storing
                        encodedValue.add(AccessController.doPrivileged(new EncodeAction(keyPass)));
                    }
                    new_idpExtValues.put(SAMLv2Model.IDP_SIGN_CERT_KEYPASS, encodedValue);
                }
            }
        }
        idpExtValues.putAll(new_idpExtValues);
        //save the standard metadata values for the Idp
        model.setIDPStdAttributeValues(realm, entityName, idpStdValues);
        //save the extended metadata values for the Idp
        model.setIDPExtAttributeValues(realm, entityName, idpExtValues, location);
        if (isHosted()) {
            //update Authentication Contexts
            model.updateIDPAuthenticationContexts(realm, entityName, getAuthenticationContexts());
            //save the encryption and signing info
            model.updateKeyinfo(realm, entityName, idpExtValues, idpStdValues, true);
        }
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "samlv2.idp.property.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : EncodeAction(com.sun.identity.security.EncodeAction) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model)

Example 44 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class IDFFSPViewBean method handleButton1Request.

/**
     * Handles save
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    retrieveCommonProperties();
    try {
        IDFFModel model = (IDFFModel) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTES);
        // update standard metadata and extended metadata           
        Map stdValues = ps.getAttributeValues(model.getEntitySPDescriptor(realm, entityName), false, model);
        Map extValues = ps.getAttributeValues(model.getAllSPExtendedMetaMap(), false, model);
        Map spAllExtValues = model.getSPEntityConfig(realm, entityName, ENTITY_LOCATION);
        spAllExtValues.putAll(extValues);
        model.updateEntitySPDescriptor(realm, entityName, stdValues, spAllExtValues, isHosted());
        model.updateSPEntityConfig(realm, entityName, spAllExtValues);
        if (isHosted()) {
            // update Authentication Contexts
            model.updateSPAuthenticationContexts(realm, entityName, getAuthenticationContexts());
        }
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "idff.entityDescriptor.provider.sp.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        debug.warning("IDFFSPViewBean -> handleButton1Request", e);
    }
    forwardTo();
}
Also used : IDFFModel(com.sun.identity.console.federation.model.IDFFModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 45 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class SAMLv2AffiliateViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
    ps.init();
    SAMLv2Model model = (SAMLv2Model) getModel();
    try {
        Map values = getStandardAffiliationValues();
        Set allSPEntities = model.getallSPEntities(realm);
        Set affiliateMembers = (Set) values.get(model.AFFILIATE_MEMBER);
        allSPEntities.removeAll(affiliateMembers);
        if (samladdRemoveModel == null) {
            samladdRemoveModel = new CCAddRemoveModel();
        }
        if ((allSPEntities != null) && !allSPEntities.isEmpty()) {
            samladdRemoveModel.setAvailableOptionList(createOptionList(allSPEntities));
        }
        if ((affiliateMembers != null) && !affiliateMembers.isEmpty()) {
            samladdRemoveModel.setSelectedOptionList(createOptionList(affiliateMembers));
        }
        ps.setAttributeValues(values, model);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    ps.setAttributeValues(getExtendedAffiliationValues(), model);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)122 Map (java.util.Map)79 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)76 HashMap (java.util.HashMap)37 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)28 Set (java.util.Set)21 HashSet (java.util.HashSet)15 List (java.util.List)10 View (com.iplanet.jato.view.View)9 IDFFModel (com.sun.identity.console.federation.model.IDFFModel)8 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)8 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)8 ArrayList (java.util.ArrayList)7 Iterator (java.util.Iterator)7 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)6 ModelControlException (com.iplanet.jato.model.ModelControlException)5 WSFedPropertiesModel (com.sun.identity.console.federation.model.WSFedPropertiesModel)5 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)5 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)4 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)4