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();
}
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);
}
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();
}
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();
}
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);
}
Aggregations