cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1415609 - /cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
Date Fri, 30 Nov 2012 12:59:15 GMT
Author: sergeyb
Date: Fri Nov 30 12:59:14 2012
New Revision: 1415609

URL: http://svn.apache.org/viewvc?rev=1415609&view=rev
Log:
[CXF-4666] Making it simpler to customize UserSubject creation

Modified:
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java?rev=1415609&r1=1415608&r2=1415609&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
Fri Nov 30 12:59:14 2012
@@ -242,8 +242,13 @@ public abstract class RedirectionBasedGr
         this.sessionAuthenticityTokenProvider = sessionAuthenticityTokenProvider;
     }
     
-    private UserSubject createUserSubject(SecurityContext securityContext) {
-        return OAuthUtils.createSubject(securityContext);
+    protected UserSubject createUserSubject(SecurityContext securityContext) {
+        UserSubject subject = getMessageContext().getContent(UserSubject.class);
+        if (subject != null) {
+            return subject;
+        } else {
+            return OAuthUtils.createSubject(securityContext);
+        }
     }
     
     protected abstract Response createErrorResponse(MultivaluedMap<String, String>
params,



Mime
View raw message