cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1241934 - in /cxf/trunk: distribution/src/main/release/samples/oauth/client/src/main/java/demo/oauth/client/controllers/ distribution/src/main/release/samples/oauth/server/ distribution/src/main/release/samples/oauth/server/src/main/java/d...
Date Wed, 08 Feb 2012 15:24:20 GMT
Author: sergeyb
Date: Wed Feb  8 15:24:19 2012
New Revision: 1241934

URL: http://svn.apache.org/viewvc?rev=1241934&view=rev
Log:
Minor updates to OAuth data classes

Modified:
    cxf/trunk/distribution/src/main/release/samples/oauth/client/src/main/java/demo/oauth/client/controllers/TemporaryCredentialsController.java
    cxf/trunk/distribution/src/main/release/samples/oauth/server/pom.xml
    cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationFailureHandler.java
    cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationSuccessfullHandler.java
    cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/webapp/oAuthLogin.jsp
    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/data/OAuthAuthorizationData.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/filters/AbstractAuthFilter.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthConstants.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java

Modified: cxf/trunk/distribution/src/main/release/samples/oauth/client/src/main/java/demo/oauth/client/controllers/TemporaryCredentialsController.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/oauth/client/src/main/java/demo/oauth/client/controllers/TemporaryCredentialsController.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/oauth/client/src/main/java/demo/oauth/client/controllers/TemporaryCredentialsController.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/oauth/client/src/main/java/demo/oauth/client/controllers/TemporaryCredentialsController.java
Wed Feb  8 15:24:19 2012
@@ -81,8 +81,7 @@ public class TemporaryCredentialsControl
             parameters.put(OAuth.OAUTH_TIMESTAMP, String.valueOf(System.currentTimeMillis()
/ 1000));
             parameters.put(OAuth.OAUTH_CALLBACK, oAuthParams.getCallbackURL());
             parameters.put("realm", "private");
-            parameters.put("x_oauth_scope", "read_info,modify_info");
-            parameters.put("x_oauth_uri", "/resources/person/*");
+            parameters.put("scope", "read_info modify_info");
 
 
             try {

Modified: cxf/trunk/distribution/src/main/release/samples/oauth/server/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/oauth/server/pom.xml?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/oauth/server/pom.xml (original)
+++ cxf/trunk/distribution/src/main/release/samples/oauth/server/pom.xml Wed Feb  8 15:24:19
2012
@@ -119,11 +119,6 @@
             <artifactId>cglib</artifactId>
             <version>2.1</version>
         </dependency>
-        <dependency>
-            <groupId>org.ow2.asm</groupId>
-            <artifactId>asm</artifactId>
-            <version>1.5.3</version>
-        </dependency>
 
 
         <dependency>

Modified: cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationFailureHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationFailureHandler.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationFailureHandler.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationFailureHandler.java
Wed Feb  8 15:24:19 2012
@@ -39,17 +39,11 @@ public class AuthenticationFailureHandle
                                         AuthenticationException exception)
         throws IOException, ServletException {
         String oauthToken = request.getParameter(OAuth.OAUTH_TOKEN);
-        String xOAuthURI = request.getParameter(OAuthConstants.X_OAUTH_URI);
         String xScope = request.getParameter(OAuthConstants.X_OAUTH_SCOPE);
 
         StringBuffer url = new StringBuffer(authorizeUrl).append("?").append(OAuth.OAUTH_TOKEN).append("=")
             .append(oauthToken);
 
-        if (!StringUtils.isEmpty(xOAuthURI)) {
-            url.append("&").append(OAuthConstants.X_OAUTH_URI).append("=")
-                .append(xOAuthURI);
-        }
-
         if (!StringUtils.isEmpty(xScope)) {
             url.append("&").append(OAuthConstants.X_OAUTH_SCOPE).append("=").append(xScope);
         }

Modified: cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationSuccessfullHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationSuccessfullHandler.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationSuccessfullHandler.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/java/demo/oauth/server/spring/AuthenticationSuccessfullHandler.java
Wed Feb  8 15:24:19 2012
@@ -46,7 +46,6 @@ public class AuthenticationSuccessfullHa
         String oauthToken = request.getParameter(OAuth.OAUTH_TOKEN);
         String authToken = request.getParameter(OAuthConstants.AUTHENTICITY_TOKEN);
         String decision = request.getParameter(OAuthConstants.AUTHORIZATION_DECISION_KEY);
-        String xOAuthURI = request.getParameter(OAuthConstants.X_OAUTH_URI);
         String xScope = request.getParameter(OAuthConstants.X_OAUTH_SCOPE);
 
         if (StringUtils.isEmpty(oauthToken)) {
@@ -63,11 +62,6 @@ public class AuthenticationSuccessfullHa
                     .append(decision);
         }
 
-        if (!StringUtils.isEmpty(xOAuthURI)) {
-            url.append("&").append(OAuthConstants.X_OAUTH_URI).append("=")
-                    .append(xOAuthURI);
-        }
-
         if (!StringUtils.isEmpty(xScope)) {
             url.append("&").append(OAuthConstants.X_OAUTH_SCOPE).append("=").append(xScope);
         }

Modified: cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/webapp/oAuthLogin.jsp
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/webapp/oAuthLogin.jsp?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/webapp/oAuthLogin.jsp
(original)
+++ cxf/trunk/distribution/src/main/release/samples/oauth/server/src/main/webapp/oAuthLogin.jsp
Wed Feb  8 15:24:19 2012
@@ -39,10 +39,6 @@ under the License.
                                value="${oauthauthorizationdata.authenticityToken}"/>
                         <input type="hidden"
                                name="<%=org.apache.cxf.rs.security.oauth.utils.OAuthConstants
-                                   .X_OAUTH_URI%>"
-                               value="<%=request.getParameter("x_oauth_uri")%>"/>
-                        <input type="hidden"
-                               name="<%=org.apache.cxf.rs.security.oauth.utils.OAuthConstants
                                    .X_OAUTH_SCOPE%>"
                                value="<%=request.getParameter("x_oauth_scope")%>"/>
 

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=1241934&r1=1241933&r2=1241934&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
Wed Feb  8 15:24:19 2012
@@ -26,6 +26,8 @@ public class Client {
     private String secretKey;
     private String applicationURI;
     private String applicationName;
+    private String applicationDescription;
+    private String relativeLogoPath;
     
     private String loginName;
         
@@ -97,6 +99,29 @@ public class Client {
     }
 
     /**
+     * Sets the description of the third-party application.
+     */
+    public void setApplicationDescription(String applicationDescription) {
+        this.applicationDescription = applicationDescription;
+    }
+
+    /**
+     * Gets the description of the third-party application.
+     * @return the application description
+     */
+    public String getApplicationDescription() {
+        return applicationDescription;
+    }
+    
+    public void setRelativeLogoPath(String relativeLogoPath) {
+        this.relativeLogoPath = relativeLogoPath;
+    }
+
+    public String getRelativeLogoPath() {
+        return relativeLogoPath;
+    }
+
+    /**
      * Gets the optional login name; can be used 
      * for enforcing the RBAC rules 
      * @return the login name

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/OAuthAuthorizationData.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/OAuthAuthorizationData.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/OAuthAuthorizationData.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/data/OAuthAuthorizationData.java
Wed Feb  8 15:24:19 2012
@@ -36,6 +36,8 @@ public class OAuthAuthorizationData impl
     private String authenticityToken;
     private String applicationName;
     private String applicationURI;
+    private String applicationDescription;
+    private String relativeLogoPath;
     private String replyTo;
     private List<? extends Permission> permissions;
     
@@ -93,4 +95,20 @@ public class OAuthAuthorizationData impl
     public String getApplicationURI() {
         return applicationURI;
     }
+
+    public void setApplicationDescription(String applicationDescription) {
+        this.applicationDescription = applicationDescription;
+    }
+
+    public String getApplicationDescription() {
+        return applicationDescription;
+    }
+
+    public void setRelativeLogoPath(String relativeLogoPath) {
+        this.relativeLogoPath = relativeLogoPath;
+    }
+
+    public String getRelativeLogoPath() {
+        return relativeLogoPath;
+    }
 }

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/filters/AbstractAuthFilter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/filters/AbstractAuthFilter.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/filters/AbstractAuthFilter.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/filters/AbstractAuthFilter.java
Wed Feb  8 15:24:19 2012
@@ -72,7 +72,6 @@ public class AbstractAuthFilter {
         ALLOWED_OAUTH_PARAMETERS = new HashSet<String>();
         ALLOWED_OAUTH_PARAMETERS.addAll(Arrays.asList(REQUIRED_PARAMETERS));
         ALLOWED_OAUTH_PARAMETERS.add(OAuth.OAUTH_VERSION);
-        ALLOWED_OAUTH_PARAMETERS.add(OAuthConstants.X_OAUTH_SCOPE);
         ALLOWED_OAUTH_PARAMETERS.add(OAuthConstants.OAUTH_CONSUMER_SECRET);
     }
     

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.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/AuthorizationRequestHandler.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
Wed Feb  8 15:24:19 2012
@@ -155,7 +155,8 @@ public class AuthorizationRequestHandler
         secData.setOauthToken(token.getTokenKey());
         secData.setApplicationName(token.getClient().getApplicationName()); 
         secData.setApplicationURI(token.getClient().getApplicationURI());
-        
+        secData.setApplicationDescription(token.getClient().getApplicationDescription());
+        secData.setRelativeLogoPath(token.getClient().getRelativeLogoPath());
         secData.setPermissions(token.getScopes());
         
         return secData;

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthConstants.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthConstants.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthConstants.java
Wed Feb  8 15:24:19 2012
@@ -36,7 +36,7 @@ public final class OAuthConstants {
     public static final String AUTHORIZATION_DECISION_ALLOW = "allow";
     public static final String AUTHORIZATION_DECISION_DENY = "deny";
 
-    public static final String X_OAUTH_SCOPE = "x_oauth_scope";
+    public static final String X_OAUTH_SCOPE = "scope";
     public static final String OAUTH_CONSUMER_SECRET = "oauth_consumer_secret";
     
     private OAuthConstants() {

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java?rev=1241934&r1=1241933&r2=1241934&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
Wed Feb  8 15:24:19 2012
@@ -175,7 +175,7 @@ public final class OAuthUtils {
         List<String> scopeList = new ArrayList<String>();
 
         if (!StringUtils.isEmpty(paramValue)) {
-            StringTokenizer tokenizer = new StringTokenizer(paramValue, ",");
+            StringTokenizer tokenizer = new StringTokenizer(paramValue, " ");
 
             while (tokenizer.hasMoreTokens()) {
                 String token = tokenizer.nextToken();



Mime
View raw message