You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/01/23 15:27:35 UTC
[3/3] syncope git commit: [SYNCOPE-999] Fixing minor things
[SYNCOPE-999] Fixing minor things
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/58520329
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/58520329
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/58520329
Branch: refs/heads/master
Commit: 58520329104ba3ae93a34b879c9a8d60edb8e7a7
Parents: e2567e4
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Mon Jan 23 16:26:59 2017 +0100
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Mon Jan 23 16:27:22 2017 +0100
----------------------------------------------------------------------
.../SyncopeAuthenticationEntryPoint.java | 43 --------------------
.../SyncopeBasicAuthenticationEntryPoint.java | 43 ++++++++++++++++++++
.../src/main/resources/securityContext.xml | 9 ++--
3 files changed, 48 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/58520329/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationEntryPoint.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationEntryPoint.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationEntryPoint.java
deleted file mode 100644
index 7f9ad7b..0000000
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationEntryPoint.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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
- *
- * 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.
- */
-package org.apache.syncope.core.spring.security;
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
-
-/**
- * Render Spring's {@link AuthenticationException} as other Syncope errors.
- */
-public class SyncopeAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {
-
- @Override
- public void commence(final HttpServletRequest request, final HttpServletResponse response,
- final AuthenticationException authException) throws IOException, ServletException {
-
- response.addHeader(RESTHeaders.ERROR_INFO, authException.getMessage());
-
- super.commence(request, response, authException);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/58520329/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPoint.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPoint.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPoint.java
new file mode 100644
index 0000000..5689ff6
--- /dev/null
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPoint.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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
+ *
+ * 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.
+ */
+package org.apache.syncope.core.spring.security;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
+
+/**
+ * Render Spring's {@link AuthenticationException} as other Syncope errors.
+ */
+public class SyncopeBasicAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {
+
+ @Override
+ public void commence(final HttpServletRequest request, final HttpServletResponse response,
+ final AuthenticationException authException) throws IOException, ServletException {
+
+ response.addHeader(RESTHeaders.ERROR_INFO, authException.getMessage());
+
+ super.commence(request, response, authException);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/58520329/core/spring/src/main/resources/securityContext.xml
----------------------------------------------------------------------
diff --git a/core/spring/src/main/resources/securityContext.xml b/core/spring/src/main/resources/securityContext.xml
index a038e8f..83b3468 100644
--- a/core/spring/src/main/resources/securityContext.xml
+++ b/core/spring/src/main/resources/securityContext.xml
@@ -55,8 +55,8 @@ under the License.
<bean id="mustChangePasswordFilter" class="org.apache.syncope.core.spring.security.MustChangePasswordFilter"/>
- <bean id="syncopeAuthenticationEntryPoint"
- class="org.apache.syncope.core.spring.security.SyncopeAuthenticationEntryPoint">
+ <bean id="basicAuthenticationEntryPoint"
+ class="org.apache.syncope.core.spring.security.SyncopeBasicAuthenticationEntryPoint">
<property name="realmName" value="Apache Syncope authentication"/>
</bean>
@@ -68,10 +68,11 @@ under the License.
<security:http-firewall ref="firewall"/>
<security:http security-context-repository-ref="securityContextRepository"
- entry-point-ref="syncopeAuthenticationEntryPoint"
+ entry-point-ref="basicAuthenticationEntryPoint"
use-expressions="false" disable-url-rewriting="false">
- <security:http-basic authentication-details-source-ref="syncopeAuthenticationDetailsSource"/>
+ <security:http-basic entry-point-ref="basicAuthenticationEntryPoint"
+ authentication-details-source-ref="syncopeAuthenticationDetailsSource"/>
<security:anonymous username="${anonymousUser}"/>
<security:intercept-url pattern="/**"/>