
web.sso-saml.manage_service_providers.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.wso2.carbon.identity.sso.saml.ui Show documentation
Show all versions of org.wso2.carbon.identity.sso.saml.ui Show documentation
SAML Web Browser SSO UI component for WSO2 Carbon
The newest version!
<%@ page import="org.apache.axis2.AxisFault" %>
<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page
import="org.wso2.carbon.CarbonError" %>
<%@ page import="org.wso2.carbon.identity.sso.saml.stub.types.SAMLSSOServiceProviderDTO" %>
<%@ page import="org.wso2.carbon.identity.sso.saml.stub.types.SAMLSSOServiceProviderInfoDTO" %>
<%@ page import="org.wso2.carbon.identity.sso.saml.ui.SAMLSSOUIConstants" %>
<%@ page import="org.wso2.carbon.identity.sso.saml.ui.SAMLSSOUIUtil" %>
<%@ page import="org.wso2.carbon.identity.sso.saml.ui.client.SAMLSSOConfigServiceClient" %>
<%@ page
import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page
import="org.wso2.carbon.utils.ServerConstants" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Collections" %>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
prefix="carbon" %>
<%
String addAction = "add_service_provider.jsp";
String filter = request.getParameter(SAMLSSOUIConstants.ISSUER_LIST_FILTER);
String cookie;
String serverURL;
ConfigurationContext configContext;
SAMLSSOConfigServiceClient spConfigClient = null;
int numberOfPages = 0;
int itemsPerPageInt = SAMLSSOUIConstants.DEFAULT_ITEMS_PER_PAGE;
String isPaginatedString = request.getParameter("isPaginated");
if (isPaginatedString != null && isPaginatedString.equals("true")) {
spConfigClient = (SAMLSSOConfigServiceClient) session.getAttribute(SAMLSSOUIConstants.CONFIG_CLIENT);
}
String paginationValue = "isPaginated=true";
if (filter == null || filter.trim().length() == 0) {
filter = (String) session.getAttribute(SAMLSSOUIConstants.ISSUER_LIST_FILTER);
if (filter == null || filter.trim().length() == 0) {
filter = "*";
}
}
filter = filter.trim();
session.setAttribute(SAMLSSOUIConstants.ISSUER_LIST_FILTER, filter);
String pageNumber = request.getParameter("pageNumber");
if (pageNumber == null) {
pageNumber = "0";
}
int pageNumberInt = 0;
try {
pageNumberInt = Integer.parseInt(pageNumber);
} catch (NumberFormatException ignored) {
}
SAMLSSOServiceProviderInfoDTO serviceProviderInfoDTO = null;
ArrayList providers =
new ArrayList();
String reload = null;
try {
reload = request.getParameter("reload");
serverURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
configContext =
(ConfigurationContext) config.getServletContext()
.getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
if (spConfigClient == null) {
spConfigClient =
new SAMLSSOConfigServiceClient(cookie, serverURL,
configContext);
session.setAttribute(SAMLSSOUIConstants.CONFIG_CLIENT, spConfigClient);
}
serviceProviderInfoDTO = spConfigClient.getRegisteredServiceProviders();
if (serviceProviderInfoDTO.getServiceProviders() != null) {
SAMLSSOServiceProviderDTO[] filteredProviders = SAMLSSOUIUtil.doFilter(filter, serviceProviderInfoDTO.getServiceProviders()) ;
numberOfPages = (int) Math.ceil((double) filteredProviders.length / itemsPerPageInt);
SAMLSSOServiceProviderDTO[] paginatedServiceProviders = SAMLSSOUIUtil.doPaging(pageNumberInt, filteredProviders);
Collections.addAll(providers, paginatedServiceProviders);
}
} catch (AxisFault e) {
CarbonError error = new CarbonError();
error.addError(e.getMessage());
request.getSession().setAttribute(CarbonError.ID, error);
%>
<%
}
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy