{
String action = actionRequest.getParameter(OpenIDConstants.OPEN_ID_REQUEST);
if (action != null)
{
// redirect action to OpenIDRelayingPartyServlet
RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
String servletRedirect = requestContext.getRequest().getContextPath()+OPEN_ID_RELAYING_PARTY_SERVLET_MAPPING+"/"+action+"?"+OpenIDConstants.OPEN_ID_RETURN+"="+requestContext.getPortalURL().getBasePath();
// perform action
if (action.equals(OpenIDConstants.OPEN_ID_LOGIN_REQUEST))
{
// access new user registration init parameters and preferences
// and save in session for consumption by the OpenIDRelayingPartyServlet
String logConfiguration = "none";
PortletPreferences prefs = actionRequest.getPreferences();
if (Boolean.parseBoolean(prefs.getValue(ENABLE_REGISTRATION_CONFIG_PREF_NAME, null)))
{
OpenIDRegistrationConfiguration registrationConfiguration = new OpenIDRegistrationConfiguration();
registrationConfiguration.setEnableRegistration(prefs.getValue(ENABLE_REGISTRATION_PREF_NAME, null));
registrationConfiguration.setUserTemplateDirectory(prefs.getValue(REGISTRATION_USER_TEMPLATE_PREF_NAME, null));
registrationConfiguration.setSubsiteRootFolder(prefs.getValue(REGISTRATION_SUBSITE_ROOT_PREF_NAME, null));
registrationConfiguration.setRoles(prefs.getValue(REGISTRATION_ROLES_PREF_NAME, null));
registrationConfiguration.setGroups(prefs.getValue(REGISTRATION_GROUPS_PREF_NAME, null));
registrationConfiguration.setProfilerRules(prefs.getValue(REGISTRATION_PROFILER_RULE_NAMES_PREF_NAME, null), prefs.getValue(REGISTRATION_PROFILER_RULE_VALUES_PREF_NAME, null));
registrationConfiguration.merge(initRegistrationConfiguration);
requestContext.setSessionAttribute(OpenIDConstants.OPEN_ID_REGISTRATION_CONFIGURATION, registrationConfiguration);
logConfiguration = "preferences";
}
else if (initRegistrationConfiguration != null)
{
requestContext.setSessionAttribute(OpenIDConstants.OPEN_ID_REGISTRATION_CONFIGURATION, initRegistrationConfiguration);
logConfiguration = "init params";
}
// login redirect to OpenIDRelayingPartyServlet
String discoveryParam = actionRequest.getParameter(OpenIDConstants.OPEN_ID_DISCOVERY);