You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2016/07/26 00:41:14 UTC

[09/42] cxf git commit: Yet another update to ClientCodeRequestFilter

Yet another update to ClientCodeRequestFilter


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

Branch: refs/heads/master-jaxrs-2.1
Commit: f376b314ea96b60043efab17397ca39fcf540de3
Parents: bf3b463
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Tue Jul 19 21:11:15 2016 +0300
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Tue Jul 19 21:11:15 2016 +0300

----------------------------------------------------------------------
 .../cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f376b314/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
index b7a0c01..dfd1826 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientCodeRequestFilter.java
@@ -124,8 +124,7 @@ public class ClientCodeRequestFilter implements ContainerRequestFilter {
     protected boolean isStartUriMatched(UriInfo ui, String absoluteRequestUri, boolean sameRedirectUri) {
         // If all request URIs can initiate a code flow then it is a match 
         // unless the current request URI matches a non-null completeUri 
-        if (startUri == null 
-            && (completeUri != null && !absoluteRequestUri.endsWith(completeUri) || !sameRedirectUri)) {
+        if (startUri == null && completeUri != null && !absoluteRequestUri.endsWith(completeUri)) {
             return true;
         }
         // If completeUri is null or startUri equals to it then check the code flow
@@ -137,7 +136,8 @@ public class ClientCodeRequestFilter implements ContainerRequestFilter {
             }
         }
         // Finally compare start URI with the request URI
-        return startUri != null && absoluteRequestUri.endsWith(startUri);
+        return startUri == null && !sameRedirectUri 
+            || startUri != null && absoluteRequestUri.endsWith(startUri);
     }
 
     private boolean codeResponseQueryParamsAvailable(MultivaluedMap<String, String> queries) {