use of com.sun.identity.console.federation.model.SAMLv2Model in project OpenAM by OpenRock.
the class SAMLv2AuthnAuthorityViewBean method getStandardAuthnAuthorityValues.
private Map getStandardAuthnAuthorityValues() {
Map map = new HashMap();
try {
SAMLv2Model model = (SAMLv2Model) getModel();
map = model.getStandardAuthnAuthorityAttributes(realm, entityName);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
return map;
}
use of com.sun.identity.console.federation.model.SAMLv2Model 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.federation.model.SAMLv2Model in project OpenAM by OpenRock.
the class SAMLv2IDPAdvancedViewBean method getExtendedValues.
private Map getExtendedValues() {
Map extendedValues = new HashMap();
try {
//gets extended metadata values
SAMLv2Model model = (SAMLv2Model) getModel();
Map attr = model.getExtendedIdentityProviderAttributes(realm, entityName);
Set entries = attr.entrySet();
Iterator iterator = entries.iterator();
//the list of values is converted to a set
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
extendedValues.put((String) entry.getKey(), convertListToSet((List) entry.getValue()));
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
return extendedValues;
}
use of com.sun.identity.console.federation.model.SAMLv2Model 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.federation.model.SAMLv2Model 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();
}
Aggregations