cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Support for the dyn reg of the OIDC rp initoated logout uris
Date Mon, 27 Feb 2017 16:27:02 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes d0b7c40c4 -> 0ba04d859


Support for the dyn reg of the OIDC rp initoated logout uris


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

Branch: refs/heads/3.1.x-fixes
Commit: 0ba04d859c11116df8b9d31163e7c65aa1addbb2
Parents: d0b7c40
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Feb 27 16:23:54 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Feb 27 16:26:44 2017 +0000

----------------------------------------------------------------------
 .../idp/OidcDynamicRegistrationService.java     | 31 +++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0ba04d85/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
index ccbc191..2e6b462 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
@@ -18,24 +18,47 @@
  */
 package org.apache.cxf.rs.security.oidc.idp;
 
+import java.util.LinkedList;
+import java.util.List;
+
 import org.apache.cxf.rs.security.oauth2.common.Client;
 import org.apache.cxf.rs.security.oauth2.services.ClientRegistration;
 import org.apache.cxf.rs.security.oauth2.services.ClientRegistrationResponse;
 import org.apache.cxf.rs.security.oauth2.services.DynamicRegistrationService;
 
 public class OidcDynamicRegistrationService extends DynamicRegistrationService {
+    private static final String RP_INITIATED_LOGOUT_URIS = "post_logout_redirect_uris";
     private boolean protectIdTokenWithClientSecret;
     
     @Override
     protected Client createNewClient(ClientRegistration request) {
-        //TODO: set OIDC specific properties as Client extra properties 
-        return super.createNewClient(request);
+        Client client = super.createNewClient(request);
+        List<String> logoutUris = request.getListStringProperty(RP_INITIATED_LOGOUT_URIS);
+        if (logoutUris != null) {
+            StringBuilder sb = new StringBuilder();
+            for (String uri : logoutUris) {
+                if (sb.length() > 0) {
+                    sb.append(" ");
+                }
+                sb.append(uri);
+            }
+            client.getProperties().put(RP_INITIATED_LOGOUT_URIS, sb.toString());
+        }
+        return client;
     }
     
     @Override
     protected ClientRegistrationResponse fromClientToRegistrationResponse(Client client)
{
-        //TODO: check OIDC specific properties in Client extra properties
-        return super.fromClientToRegistrationResponse(client);
+        ClientRegistrationResponse resp = super.fromClientToRegistrationResponse(client);
+        String logoutUris = client.getProperties().get(RP_INITIATED_LOGOUT_URIS);
+        if (logoutUris != null) {
+            List<String> list = new LinkedList<String>();
+            for (String s : logoutUris.split(" ")) { 
+                list.add(s);
+            }
+            resp.setProperty(RP_INITIATED_LOGOUT_URIS, list);
+        }
+        return resp;
     }
     
     @Override


Mime
View raw message