AuthPropertiesViewBean.java revision 6328925537fd7e5d853fe7540b10d6f909057805
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * The contents of this file are subject to the terms
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * of the Common Development and Distribution License
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * (the License). You may not use this file except in
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * compliance with the License.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * You can obtain a copy of the License at
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * See the License for the specific language governing
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * permission and limitations under the License.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * When distributing Covered Code, include this CDDL
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Header Notice in each file and include the License file
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * If applicable, add the following below the CDDL Header,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * with the fields enclosed by brackets [] replaced by
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * your own identifying information:
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Portions Copyrighted 2014-2015 ForgeRock AS.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * $Id: AuthPropertiesViewBean.java,v 1.5 2008/07/07 20:39:19 veiming Exp $
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterpackage com.sun.identity.console.authentication;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport static com.sun.identity.console.XuiRedirectHelper.getRedirectRealm;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport static com.sun.identity.console.XuiRedirectHelper.isXuiAdminConsoleEnabled;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport static com.sun.identity.console.XuiRedirectHelper.redirectToXui;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.iplanet.jato.model.ModelControlException;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.iplanet.jato.view.event.DisplayEvent;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.iplanet.jato.view.event.RequestInvocationEvent;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.authentication.config.AMAuthenticationInstance;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.authentication.config.AMAuthenticationManager;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.authentication.config.AMConfigurationException;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.authentication.model.AuthConfigurationModel;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.authentication.model.AuthConfigurationModelImpl;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.authentication.model.AuthPropertiesModel;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.authentication.model.AuthPropertiesModelImpl;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.base.AMPropertySheet;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.base.model.AMAdminConstants;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.base.model.AMConsoleException;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.base.model.AMModel;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.base.model.AMModelBase;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.base.model.AMPropertySheetModel;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.delegation.model.DelegationConfig;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.console.realm.RealmPropertiesBase;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.identity.shared.datastruct.OrderedSet;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosterimport com.sun.web.ui.view.pagetitle.CCPageTitle;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * This is the main authentication properties view page which displays the
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * authentication instances, authentication configurations, and a few of
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * the core authentication properties (with a link to the full set of
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * properties). From this view the user can create new auth instances,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * configurations, and basic property editing. The XML file used to build
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * the layout is propertyRealmAuth.xml. tblAuthInstance.xml and
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * tblAuthConfig.xml define the table structures for the instance and config
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * tables respectively.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster public static final String DEFAULT_DISPLAY_URL =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster public static final String INSTANCE_MSG = "missingInstanceMessage";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster public static final String REALM_AUTH = "realm_authentication";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster protected static final String PROPERTY_ATTRIBUTE = "propertyAttributes";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private boolean tablePopulated = false;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private boolean initialized = false;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String PGTITLE_TWO_BTNS = "pageTitle";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private AMPropertySheetModel propertySheetModel;
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster // instance table properties
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String AUTH_INSTANCE_TABLE =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "authenticationModuleInstanceTable";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CREATE_INSTANCE_BUTTON = "createInstanceButton";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String DELETE_INSTANCE_BUTTON = "deleteInstanceButton";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String NAME_COLUMN_LABEL = "nameColumnLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String NAME_COLUMN_DATA = "nameColumnData";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String NAME_COLUMN_DATA_NO_HREF =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "nameColumnDataNoHref";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String TYPE_COLUMN_LABEL = "typeColumnLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String TYPE_COLUMN_DATA = "typeColumnData";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String ACTION_COLUMN_LABEL ="actionColumnLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String ACTION_COLUMN_HREF = "actionColumnHREF";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String ACTION_COLUMN_HREF_LABEL =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "actionColumnHREFLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster // configuration table properties
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String AUTH_CONFIG_TABLE =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "authenticationConfigurationTable";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CREATE_CONFIG_BUTTON = "createConfigButton";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String DELETE_CONFIG_BUTTON = "deleteConfigButton";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CONFIG_NAME_COLUMN_LABEL =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "configNameColumnLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CONFIG_NAME_COLUMN_DATA =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "configNameColumnData";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CONFIG_ACTION_COLUMN_LABEL =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "configActionColumnLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CONFIG_ACTION_COLUMN_HREF =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "configActionColumnHREF";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String CONFIG_ACTION_COLUMN_HREF_LABEL =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "configActionColumnHREFLabel";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String AUTH_CONFIG = "iplanet-am-auth-org-config";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String ADMIN_AUTH_CONFIG =
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster "iplanet-am-auth-admin-auth-module";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private static final String INSTANCES_REMOVED = "instancesRemoved";
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Creates a authentication domains view bean.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster super("AuthProperties");
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster protected void initialize() {
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster String realmName = (String)getPageSessionAttribute(
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster protected void registerChildren() {
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster registerChild(PROPERTY_ATTRIBUTE, AMPropertySheet.class);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster view = new AMPropertySheet(this, propertySheetModel, name);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster } else if (propertySheetModel.isChildSupported(name)) {
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster view = propertySheetModel.createChild(this, name, getModel());
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster public void beginDisplay(DisplayEvent event) throws ModelControlException {
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster redirectToXui(getRequestContext().getRequest(), redirectRealm,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster MessageFormat.format("realms/{0}/authentication", URLEncoder.encode(redirectRealm, "UTF-8")));
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster throw new IllegalStateException("UTF-8 encoding not supported", e);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster private void populateConfigTable() {
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster CCActionTableModel tableModel = (CCActionTableModel)
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster propertySheetModel.getModel(AUTH_CONFIG_TABLE);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster // get config names from previous pass. Need to use an ordered set
boolean firstEntry = true;
if (!firstEntry) {
firstEntry = false;
private void populateConfigMenu() {
private void populateInstanceTable() {
tablePopulated = true;
boolean firstEntry = true;
} catch (AMConfigurationException e) {
if (!firstEntry) {
firstEntry = false;
} catch (AMConfigurationException e) {
private void createPageTitleModel() {
private void createInstanceTable() {
private void createConfigurationTable() {
"authentication.configuration.table.name.column");
"authentication.configuration.table.action.column");
"authentication.configuration.table.create.button");
"authentication.configuration.table.delete.button");
public void handleAdvancedOptionButtonRequest(
) throws ModelControlException {
public void handleCreateConfigButtonRequest(
) throws ModelControlException {
public void handleDeleteConfigButtonRequest(
) throws ModelControlException
"authentication.config.deleted");
"authentication.config.deleted.multiple");
} catch (AMConsoleException e) {
e.getMessage());
forwardTo();
public void handleCreateInstanceButtonRequest(
public void handleDeleteInstanceButtonRequest(
) throws ModelControlException
} catch (AMConsoleException e) {
e.getMessage());
forwardTo();
throws ModelControlException
} catch (AMConsoleException a) {
forwardTo();
forwardTo();
public void handleActionColumnHREFRequest(
) throws ModelControlException
forwardTo();
public void handleConfigActionColumnHREFRequest(
) throws ModelControlException
throws NavigationException