cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: Fix oauth sample with spring securty 4.1
Date Fri, 10 Jun 2016 19:04:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 73e9c7424 -> ca2f8e811


Fix oauth sample with spring securty 4.1


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ca2f8e81
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ca2f8e81
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ca2f8e81

Branch: refs/heads/master
Commit: ca2f8e81168b5b4ca72fa6c3c4529109c7d7c5d0
Parents: 73e9c74
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Jun 10 15:04:14 2016 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Jun 10 15:04:14 2016 -0400

----------------------------------------------------------------------
 .../server/src/main/java/demo/oauth/server/CustomAuth.java    | 4 ++++
 .../oauth/server/spring/SpringOAuthAuthenticationFilter.java  | 4 ++--
 .../oauth/server/src/main/webapp/WEB-INF/security-beans.xml   | 7 +++++--
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ca2f8e81/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/CustomAuth.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/CustomAuth.java
b/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/CustomAuth.java
index ca734ca..7a485a3 100644
--- a/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/CustomAuth.java
+++ b/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/CustomAuth.java
@@ -28,6 +28,10 @@ import org.springframework.security.web.authentication.LoginUrlAuthenticationEnt
 
 
 public class CustomAuth extends LoginUrlAuthenticationEntryPoint {
+    public CustomAuth(String v) {
+        super(v);
+    }
+    
     @Override
     public void commence(HttpServletRequest request, HttpServletResponse response,
                          AuthenticationException authException) throws IOException, ServletException
{

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca2f8e81/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/SpringOAuthAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/SpringOAuthAuthenticationFilter.java
b/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/SpringOAuthAuthenticationFilter.java
index f977912..09d3a5e 100644
--- a/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/SpringOAuthAuthenticationFilter.java
+++ b/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/SpringOAuthAuthenticationFilter.java
@@ -34,7 +34,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.springframework.security.authentication.AnonymousAuthenticationToken;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.GrantedAuthorityImpl;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.context.SecurityContextHolder;
 
 public class SpringOAuthAuthenticationFilter implements Filter {
@@ -53,7 +53,7 @@ public class SpringOAuthAuthenticationFilter implements Filter {
 
         if (authorities != null) {
             for (String authority : authorities) {
-                grantedAuthorities.add(new GrantedAuthorityImpl(authority));
+                grantedAuthorities.add(new SimpleGrantedAuthority(authority));
             }
 
             Authentication auth = new AnonymousAuthenticationToken(UUID.randomUUID().toString(),

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca2f8e81/distribution/src/main/release/samples/oauth/server/src/main/webapp/WEB-INF/security-beans.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/oauth/server/src/main/webapp/WEB-INF/security-beans.xml
b/distribution/src/main/release/samples/oauth/server/src/main/webapp/WEB-INF/security-beans.xml
index 40da498..fe03d4b 100644
--- a/distribution/src/main/release/samples/oauth/server/src/main/webapp/WEB-INF/security-beans.xml
+++ b/distribution/src/main/release/samples/oauth/server/src/main/webapp/WEB-INF/security-beans.xml
@@ -17,7 +17,10 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
                        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.1.xsd
+        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
     <beans:bean id="authenticationSuccHandler" class="demo.oauth.server.spring.AuthenticationSuccessfullHandler">
         <beans:property name="defaultTargetUrl" value="/app/newClientForm.jsp"/>
         <beans:property name="confirmationUrl" value="/auth/oauth/authorize/decision"/>
@@ -27,7 +30,7 @@
     </beans:bean>
     <global-method-security secured-annotations="enabled" jsr250-annotations="enabled"/>
     <beans:bean id="entryPoint" class="demo.oauth.server.CustomAuth">
-        <beans:property name="loginFormUrl" value="/index.jsp"/>
+        <beans:constructor-arg value="/index.jsp"/>
     </beans:bean>
 
     <http pattern="/oAuthLogin.jsp" security="none" />


Mime
View raw message