Commit 717e0038 authored by Misagh Moayyed's avatar Misagh Moayyed
Browse files

fixed issue with serialization

parent 1e69be0b
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
package org.jasig.cas.authentication.principal; package org.jasig.cas.authentication.principal;
import java.io.Serializable;
/** /**
* Represents the task of building a CAS response * Represents the task of building a CAS response
* that is returned by a service. * that is returned by a service.
...@@ -26,7 +28,7 @@ package org.jasig.cas.authentication.principal; ...@@ -26,7 +28,7 @@ package org.jasig.cas.authentication.principal;
* @param <T> the type parameter * @param <T> the type parameter
* @since 4.2.0 * @since 4.2.0
*/ */
public interface ResponseBuilder<T extends WebApplicationService> { public interface ResponseBuilder<T extends WebApplicationService> extends Serializable {
/** /**
* Build response. The implementation must produce * Build response. The implementation must produce
......
...@@ -31,6 +31,8 @@ import java.util.Map; ...@@ -31,6 +31,8 @@ import java.util.Map;
* @since 4.2 * @since 4.2
*/ */
public abstract class AbstractWebApplicationServiceResponseBuilder implements ResponseBuilder<WebApplicationService> { public abstract class AbstractWebApplicationServiceResponseBuilder implements ResponseBuilder<WebApplicationService> {
private static final long serialVersionUID = -4584738964007702423L;
protected final Logger logger = LoggerFactory.getLogger(getClass()); protected final Logger logger = LoggerFactory.getLogger(getClass());
/** /**
......
...@@ -32,6 +32,7 @@ import java.util.Map; ...@@ -32,6 +32,7 @@ import java.util.Map;
* @since 4.2 * @since 4.2
*/ */
public class WebApplicationServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder { public class WebApplicationServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder {
private static final long serialVersionUID = -851233878780818494L;
private final Response.ResponseType responseType; private final Response.ResponseType responseType;
/** /**
......
...@@ -29,6 +29,7 @@ import javax.net.ssl.X509TrustManager; ...@@ -29,6 +29,7 @@ import javax.net.ssl.X509TrustManager;
import org.apache.http.conn.ssl.NoopHostnameVerifier; import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
/** /**
...@@ -74,7 +75,9 @@ public class SimpleHttpClientTests { ...@@ -74,7 +75,9 @@ public class SimpleHttpClientTests {
public X509Certificate[] getAcceptedIssuers() { public X509Certificate[] getAcceptedIssuers() {
return null; return null;
} }
@Override
public void checkClientTrusted(final X509Certificate[] certs, final String authType) {} public void checkClientTrusted(final X509Certificate[] certs, final String authType) {}
@Override
public void checkServerTrusted(final X509Certificate[] certs, final String authType) {} public void checkServerTrusted(final X509Certificate[] certs, final String authType) {}
}; };
final SSLContext sc = SSLContext.getInstance("SSL"); final SSLContext sc = SSLContext.getInstance("SSL");
......
...@@ -25,7 +25,7 @@ import org.jasig.cas.authentication.principal.AbstractWebApplicationServiceRespo ...@@ -25,7 +25,7 @@ import org.jasig.cas.authentication.principal.AbstractWebApplicationServiceRespo
import org.jasig.cas.authentication.principal.Response; import org.jasig.cas.authentication.principal.Response;
import org.jasig.cas.authentication.principal.WebApplicationService; import org.jasig.cas.authentication.principal.WebApplicationService;
import org.jasig.cas.support.openid.OpenIdProtocolConstants; import org.jasig.cas.support.openid.OpenIdProtocolConstants;
import org.jasig.cas.ticket.TicketException; import org.jasig.cas.ticket.AbstractTicketException;
import org.jasig.cas.validation.Assertion; import org.jasig.cas.validation.Assertion;
import org.openid4java.association.Association; import org.openid4java.association.Association;
import org.openid4java.message.AuthRequest; import org.openid4java.message.AuthRequest;
...@@ -45,6 +45,8 @@ import java.util.Map; ...@@ -45,6 +45,8 @@ import java.util.Map;
*/ */
public class OpenIdServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder { public class OpenIdServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder {
private static final long serialVersionUID = -4581238964007702423L;
private final ServerManager serverManager; private final ServerManager serverManager;
private final CentralAuthenticationService centralAuthenticationService; private final CentralAuthenticationService centralAuthenticationService;
private final ParameterList parameterList; private final ParameterList parameterList;
...@@ -104,7 +106,7 @@ public class OpenIdServiceResponseBuilder extends AbstractWebApplicationServiceR ...@@ -104,7 +106,7 @@ public class OpenIdServiceResponseBuilder extends AbstractWebApplicationServiceR
logger.warn("Association does not exist or is not valid"); logger.warn("Association does not exist or is not valid");
successFullAuthentication = false; successFullAuthentication = false;
} }
} catch (final TicketException te) { } catch (final AbstractTicketException te) {
logger.error("Could not validate ticket : {}", te.getMessage(), te); logger.error("Could not validate ticket : {}", te.getMessage(), te);
successFullAuthentication = false; successFullAuthentication = false;
} }
......
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to Apereo under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Apereo licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<Configuration>
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d %p [%c] - &lt;%m&gt;%n"/>
</Console>
<RollingFile name="file" fileName="target/openid.log" append="true"
filePattern="openid-%d{yyyy-MM-dd-HH}-%i.log.gz">
<PatternLayout pattern="%d %p [%c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<Root level="warn">
<AppenderRef ref="console"/>
</Root>
</Loggers>
</Configuration>
...@@ -49,6 +49,8 @@ import java.util.Map; ...@@ -49,6 +49,8 @@ import java.util.Map;
*/ */
public class GoogleAccountsServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder { public class GoogleAccountsServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder {
private static final long serialVersionUID = -4584732364007702423L;
private final PrivateKey privateKey; private final PrivateKey privateKey;
private final PublicKey publicKey; private final PublicKey publicKey;
private final GoogleSaml20ObjectBuilder samlObjectBuilder; private final GoogleSaml20ObjectBuilder samlObjectBuilder;
......
...@@ -34,6 +34,8 @@ import java.util.Map; ...@@ -34,6 +34,8 @@ import java.util.Map;
*/ */
public class SamlServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder { public class SamlServiceResponseBuilder extends AbstractWebApplicationServiceResponseBuilder {
private static final long serialVersionUID = -4584738964007702003L;
@Override @Override
public Response build(final WebApplicationService service, final String ticketId) { public Response build(final WebApplicationService service, final String ticketId) {
final Map<String, String> parameters = new HashMap<>(); final Map<String, String> parameters = new HashMap<>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment