You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by lm...@apache.org on 2010/11/24 00:29:40 UTC

svn commit: r1038381 - /cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityFilter.java

Author: lmoren
Date: Tue Nov 23 23:29:39 2010
New Revision: 1038381

URL: http://svn.apache.org/viewvc?rev=1038381&view=rev
Log:
- minor fixes

Modified:
    cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityFilter.java

Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityFilter.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityFilter.java?rev=1038381&r1=1038380&r2=1038381&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityFilter.java (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/main/java/org/apache/cxf/auth/oauth/interceptors/OAuthSecurityFilter.java Tue Nov 23 23:29:39 2010
@@ -39,6 +39,7 @@ import net.oauth.OAuthConsumer;
 import net.oauth.OAuthMessage;
 import net.oauth.OAuthProblemException;
 import net.oauth.server.OAuthServlet;
+
 import org.apache.cxf.auth.oauth.provider.Client;
 import org.apache.cxf.auth.oauth.provider.OAuthDataProvider;
 import org.apache.cxf.auth.oauth.tokens.AccessToken;
@@ -62,9 +63,9 @@ public class OAuthSecurityFilter impleme
     }
 
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws
-            IOException, ServletException {
-        HttpServletRequest req = (HttpServletRequest) request;
-        HttpServletResponse resp = (HttpServletResponse) response;
+        IOException, ServletException {
+        HttpServletRequest req = (HttpServletRequest)request;
+        HttpServletResponse resp = (HttpServletResponse)response;
 
         try {
             if (LOG.isLoggable(Level.FINE)) {
@@ -72,14 +73,14 @@ public class OAuthSecurityFilter impleme
             }
             OAuthMessage oAuthMessage = OAuthServlet.getMessage(req, req.getRequestURL().toString());
             oAuthMessage.requireParameters(OAuth.OAUTH_CONSUMER_KEY,
-                    OAuth.OAUTH_TOKEN,
-                    OAuth.OAUTH_SIGNATURE_METHOD,
-                    OAuth.OAUTH_SIGNATURE,
-                    OAuth.OAUTH_TIMESTAMP,
-                    OAuth.OAUTH_NONCE);
+                OAuth.OAUTH_TOKEN,
+                OAuth.OAUTH_SIGNATURE_METHOD,
+                OAuth.OAUTH_SIGNATURE,
+                OAuth.OAUTH_TIMESTAMP,
+                OAuth.OAUTH_NONCE);
 
             final AccessToken accessToken = dataProvider
-                    .getAccessToken(oAuthMessage.getToken(), oAuthMessage.getConsumerKey());
+                .getAccessToken(oAuthMessage.getToken(), oAuthMessage.getConsumerKey());
 
             //check if access token is not null
             if (accessToken == null) {
@@ -88,7 +89,7 @@ public class OAuthSecurityFilter impleme
             }
 
             //check valid scope
-            String servletPath = ((HttpServletRequest) request).getPathInfo();
+            String servletPath = ((HttpServletRequest)request).getPathInfo();
             List<String> scopes = accessToken.getScopes();
             boolean foundValidScope = false;
             for (String scope : scopes) {
@@ -113,8 +114,8 @@ public class OAuthSecurityFilter impleme
             Client authInfo = accessToken.getClient();
 
             OAuthConsumer consumer = new OAuthConsumer(authInfo.getCallbackURL(),
-                    authInfo.getConsumerKey(),
-                    authInfo.getSecretKey(), null);
+                authInfo.getConsumerKey(),
+                authInfo.getSecretKey(), null);
 
             OAuthAccessor accessor = new OAuthAccessor(consumer);