cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1293448 - in /cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth: data/Client.java services/RequestTokenHandler.java
Date Fri, 24 Feb 2012 21:55:26 GMT
Author: sergeyb
Date: Fri Feb 24 21:55:26 2012
New Revision: 1293448

URL: http://svn.apache.org/viewvc?rev=1293448&view=rev
Log:
Updating OAuth10 client to have both applicationURI and callback properties

Modified:
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/Client.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/RequestTokenHandler.java

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/Client.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/Client.java?rev=1293448&r1=1293447&r2=1293448&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/Client.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/Client.java
Fri Feb 24 21:55:26 2012
@@ -28,7 +28,7 @@ public class Client {
     private String applicationName;
     private String applicationDescription;
     private String logoUri;
-    
+    private String callbackURI;
     private String loginName;
         
     private AccessToken preAuthorizedToken;
@@ -178,4 +178,12 @@ public class Client {
     public AccessToken getPreAuthorizedToken() {
         return preAuthorizedToken;
     }
+
+    public void setCallbackURI(String callbackURI) {
+        this.callbackURI = callbackURI;
+    }
+
+    public String getCallbackURI() {
+        return callbackURI;
+    }
 }

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/RequestTokenHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/RequestTokenHandler.java?rev=1293448&r1=1293447&r2=1293448&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/RequestTokenHandler.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/RequestTokenHandler.java
Fri Feb 24 21:55:26 2012
@@ -120,8 +120,11 @@ public class RequestTokenHandler {
     protected void validateCallbackURL(Client client,
                                        String oauthCallback) throws OAuthProblemException
{
 
-        if (!StringUtils.isEmpty(client.getApplicationURI())
-                    && !oauthCallback.startsWith(client.getApplicationURI())) {
+        if (StringUtils.isEmpty(oauthCallback) 
+            || client.getCallbackURI() != null
+                && !oauthCallback.equals(client.getCallbackURI())
+            || client.getApplicationURI() != null
+                && !oauthCallback.startsWith(client.getApplicationURI())) {
             OAuthProblemException problemEx = new OAuthProblemException(
                 OAuth.Problems.PARAMETER_REJECTED + " - " + OAuth.OAUTH_CALLBACK);
             problemEx



Mime
View raw message