cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-5607] Adding an IdToken provider for the auth cases only, and removing some redundndant interfaces
Date Thu, 25 Jun 2015 13:28:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 5e37834a5 -> 1cfdfbb28


[CXF-5607] Adding an IdToken provider for the auth cases only, and removing some redundndant
interfaces


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1cfdfbb2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1cfdfbb2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1cfdfbb2

Branch: refs/heads/3.0.x-fixes
Commit: 1cfdfbb28ccfaa21445eaadf1cb7cbf849508958
Parents: 5e37834
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Jun 25 14:23:51 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Jun 25 14:27:40 2015 +0100

----------------------------------------------------------------------
 .../oidc/rp/OidcRpAuthenticationService.java       | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1cfdfbb2/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
index d55ba0c..58a3f59 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
@@ -41,20 +41,20 @@ public class OidcRpAuthenticationService {
     private String tokenFormParameter = "idtoken"; 
     @Context
     private MessageContext mc; 
-    private UserInfoClient userInfoClient;
+    private IdTokenValidator idTokenValidator;
     private OAuthClientUtils.Consumer consumer;
     
-    public void setUserInfoClient(UserInfoClient userInfoClient) {
-        this.userInfoClient = userInfoClient;
+    public void setIdTokenValidator(IdTokenValidator validator) {
+        this.idTokenValidator = validator;
     }
     
     @POST
-    @Path("complete")
+    @Path("signin")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     public Response completeScriptAuthentication(MultivaluedMap<String, String> map)
{
         String idTokenParamValue = map.getFirst(tokenFormParameter);
         OidcClientTokenContextImpl ctx = new OidcClientTokenContextImpl();
-        ctx.setIdToken(userInfoClient.getIdToken(idTokenParamValue, consumer.getKey()));
+        ctx.setIdToken(idTokenValidator.getIdToken(idTokenParamValue, consumer.getKey()));
         return completeAuthentication(ctx);   
     }
     
@@ -63,7 +63,8 @@ public class OidcRpAuthenticationService {
     public Response completeAuthentication(@Context OidcClientTokenContext oidcContext) {
         stateManager.setClientTokenContext(mc, oidcContext);
         URI redirectUri = null;
-        String location = oidcContext.getState().getFirst("state");
+        MultivaluedMap<String, String> state = oidcContext.getState();
+        String location = state != null ? state.getFirst("state") : null;
         if (location == null) {
             String basePath = (String)mc.get("http.base.path");
             redirectUri = UriBuilder.fromUri(basePath).path(defaultLocation).build();
@@ -84,4 +85,8 @@ public class OidcRpAuthenticationService {
     public void setTokenFormParameter(String tokenFormParameter) {
         this.tokenFormParameter = tokenFormParameter;
     }
+
+    public void setConsumer(OAuthClientUtils.Consumer consumer) {
+        this.consumer = consumer;
+    }
 }


Mime
View raw message