incubator-amber-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1081284 - /incubator/amber/trunk/oauth-2.0/oauth2-rs-filter/src/main/java/org/apache/amber/oauth2/rsfilter/OAuthFilter.java
Date Mon, 14 Mar 2011 08:41:06 GMT
Author: tommaso
Date: Mon Mar 14 08:41:06 2011
New Revision: 1081284

URL: http://svn.apache.org/viewvc?rev=1081284&view=rev
Log:
[AMBER-16] - applied patch by Ben Noordhuis

Modified:
    incubator/amber/trunk/oauth-2.0/oauth2-rs-filter/src/main/java/org/apache/amber/oauth2/rsfilter/OAuthFilter.java

Modified: incubator/amber/trunk/oauth-2.0/oauth2-rs-filter/src/main/java/org/apache/amber/oauth2/rsfilter/OAuthFilter.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/oauth-2.0/oauth2-rs-filter/src/main/java/org/apache/amber/oauth2/rsfilter/OAuthFilter.java?rev=1081284&r1=1081283&r2=1081284&view=diff
==============================================================================
--- incubator/amber/trunk/oauth-2.0/oauth2-rs-filter/src/main/java/org/apache/amber/oauth2/rsfilter/OAuthFilter.java
(original)
+++ incubator/amber/trunk/oauth-2.0/oauth2-rs-filter/src/main/java/org/apache/amber/oauth2/rsfilter/OAuthFilter.java
Mon Mar 14 08:41:06 2011
@@ -109,10 +109,16 @@ public class OAuthFilter implements Filt
 
             final OAuthDecision decision = provider.validateRequest(realm, accessToken, req);
 
+            final Principal principal = decision.getPrincipal();
+
             request = new HttpServletRequestWrapper((HttpServletRequest)request) {
                 @Override
+                public String getRemoteUser() {
+                    return principal != null ? principal.getName() : null;
+                }
+                @Override
                 public Principal getUserPrincipal() {
-                    return decision.getPrincipal();
+                    return principal;
                 }
 
             };



Mime
View raw message