public SyncopeClientFactoryBean newClientFactory() { return new SyncopeClientFactoryBean(). setAddress(scheme + "://" + host + ":" + port + StringUtils.prependIfMissing(rootPath, "/")). setUseCompression(BooleanUtils.toBoolean(useGZIPCompression)); }
@Override public void contextInitialized(final ServletContextEvent sce) { // read saml2spagent.properties Properties props = PropertyUtils.read(getClass(), SAML2SP_AGENT_PROPERTIES, "conf.directory"); String anonymousUser = props.getProperty("anonymousUser"); assertNotNull(anonymousUser, "<anonymousUser>"); String anonymousKey = props.getProperty("anonymousKey"); assertNotNull(anonymousKey, "<anonymousKey>"); String scheme = props.getProperty("scheme"); assertNotNull(scheme, "<scheme>"); String host = props.getProperty("host"); assertNotNull(host, "<host>"); String port = props.getProperty("port"); assertNotNull(port, "<port>"); String rootPath = props.getProperty("rootPath"); assertNotNull(rootPath, "<rootPath>"); String useGZIPCompression = props.getProperty("useGZIPCompression"); assertNotNull(useGZIPCompression, "<useGZIPCompression>"); SyncopeClientFactoryBean clientFactory = new SyncopeClientFactoryBean(). setAddress(scheme + "://" + host + ":" + port + "/" + rootPath). setUseCompression(BooleanUtils.toBoolean(useGZIPCompression)); sce.getServletContext().setAttribute(Constants.SYNCOPE_CLIENT_FACTORY, clientFactory); sce.getServletContext().setAttribute( Constants.SYNCOPE_ANONYMOUS_CLIENT, clientFactory.create(new AnonymousAuthenticationHandler(anonymousUser, anonymousKey))); }
@Override public void contextInitialized(final ServletContextEvent sce) { // read oidcclientagent.properties Properties props = PropertyUtils.read(getClass(), OIDCCLIENT_AGENT_PROPERTIES, "conf.directory"); String anonymousUser = props.getProperty("anonymousUser"); assertNotNull(anonymousUser, "<anonymousUser>"); String anonymousKey = props.getProperty("anonymousKey"); assertNotNull(anonymousKey, "<anonymousKey>"); String scheme = props.getProperty("scheme"); assertNotNull(scheme, "<scheme>"); String host = props.getProperty("host"); assertNotNull(host, "<host>"); String port = props.getProperty("port"); assertNotNull(port, "<port>"); String rootPath = props.getProperty("rootPath"); assertNotNull(rootPath, "<rootPath>"); String useGZIPCompression = props.getProperty("useGZIPCompression"); assertNotNull(useGZIPCompression, "<useGZIPCompression>"); SyncopeClientFactoryBean clientFactory = new SyncopeClientFactoryBean(). setAddress(scheme + "://" + host + ":" + port + "/" + rootPath). setUseCompression(BooleanUtils.toBoolean(useGZIPCompression)); sce.getServletContext().setAttribute(Constants.SYNCOPE_CLIENT_FACTORY, clientFactory); sce.getServletContext().setAttribute( Constants.SYNCOPE_ANONYMOUS_CLIENT, clientFactory.create(new AnonymousAuthenticationHandler(anonymousUser, anonymousKey))); }
setAddress(scheme + "://" + host + ":" + port + StringUtils.prependIfMissing(rootPath, "/")). setContentType(SyncopeClientFactoryBean.ContentType.JSON). setUseCompression(BooleanUtils.toBoolean(useGZIPCompression));
setAddress(scheme + "://" + host + ":" + port + StringUtils.prependIfMissing(rootPath, "/")). setContentType(SyncopeClientFactoryBean.ContentType.JSON). setUseCompression(BooleanUtils.toBoolean(useGZIPCompression));