Repository: cxf
Updated Branches:
  refs/heads/master 06190315f -> c686b1a36


Prototyping OIDC Keys service


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

Branch: refs/heads/master
Commit: c686b1a36b26a5b7b9b011994b0f81f34317f5e2
Parents: 0619031
Author: Sergey Beryozkin <sberyoz...@gmail.com>
Authored: Wed Nov 25 14:01:51 2015 +0000
Committer: Sergey Beryozkin <sberyoz...@gmail.com>
Committed: Wed Nov 25 14:01:51 2015 +0000

----------------------------------------------------------------------
 .../rs/security/oidc/idp/OidcKeysService.java   | 46 ++++++++++++++++++++
 1 file changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c686b1a3/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcKeysService.java
----------------------------------------------------------------------
diff --git 
a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcKeysService.java
 
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcKeysService.java
new file mode 100644
index 0000000..f6c214f
--- /dev/null
+++ 
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcKeysService.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.rs.security.oidc.idp;
+
+import java.util.Properties;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+import org.apache.cxf.rs.security.jose.jwk.JsonWebKeys;
+import org.apache.cxf.rs.security.jose.jws.JwsUtils;
+
+@Path("keys")
+public class OidcKeysService {
+
+    private volatile JsonWebKeys keySet;
+    
+    @GET
+    @Produces("application/json")
+    public JsonWebKeys getPublicVerificationKeys() {
+        Properties props = JwsUtils.loadSignatureInProperties(true);
+        if (keySet == null) {
+            keySet = 
JwsUtils.loadPublicVerificationKeys(JAXRSUtils.getCurrentMessage(), props);
+        }
+        return keySet;
+    }
+    
+}

Reply via email to