cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Adding missing OIDC filter classes
Date Wed, 24 Dec 2014 17:16:13 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes c7053bc56 -> cbcd557e5


Adding missing OIDC filter classes


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

Branch: refs/heads/3.0.x-fixes
Commit: cbcd557e540309902de3262f6aa23b071882261b
Parents: c7053bc
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Dec 24 17:09:44 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Dec 24 17:15:48 2014 +0000

----------------------------------------------------------------------
 .../oidc/rp/OidcClientCodeRequestFilter.java    | 38 +++++++++++++++++
 .../oidc/rp/OidcClientTokenContext.java         | 43 ++++++++++++++++++++
 2 files changed, 81 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cbcd557e/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientCodeRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientCodeRequestFilter.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientCodeRequestFilter.java
new file mode 100644
index 0000000..f5f9cc5
--- /dev/null
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientCodeRequestFilter.java
@@ -0,0 +1,38 @@
+/**
+ * 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.rp;
+
+import org.apache.cxf.rs.security.oauth2.client.ClientCodeRequestFilter;
+import org.apache.cxf.rs.security.oauth2.client.ClientTokenContext;
+import org.apache.cxf.rs.security.oauth2.common.ClientAccessToken;
+
+public class OidcClientCodeRequestFilter extends ClientCodeRequestFilter {
+
+    private UserInfoClient userInfoClient;
+    @Override
+    protected ClientTokenContext createTokenContext(ClientAccessToken at) {
+        OidcClientTokenContext ctx = new OidcClientTokenContext();
+        ctx.setIdToken(userInfoClient.getIdToken(at, getConsumer().getKey()));
+        ctx.setUserInfo(userInfoClient.getUserInfo(at, ctx.getIdToken()));
+        return ctx;
+    }
+    public void setUserInfoClient(UserInfoClient userInfoClient) {
+        this.userInfoClient = userInfoClient;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/cbcd557e/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
new file mode 100644
index 0000000..696879c
--- /dev/null
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcClientTokenContext.java
@@ -0,0 +1,43 @@
+/**
+ * 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.rp;
+
+import java.io.Serializable;
+
+import org.apache.cxf.rs.security.oauth2.client.ClientTokenContext;
+import org.apache.cxf.rs.security.oidc.common.IdToken;
+import org.apache.cxf.rs.security.oidc.common.UserInfo;
+
+public class OidcClientTokenContext extends ClientTokenContext implements Serializable {
+    private static final long serialVersionUID = 117239739331303618L;
+    private IdToken idToken;
+    private UserInfo userInfo;
+    public IdToken getIdToken() {
+        return idToken;
+    }
+    public void setIdToken(IdToken idToken) {
+        this.idToken = idToken;
+    }
+    public UserInfo getUserInfo() {
+        return userInfo;
+    }
+    public void setUserInfo(UserInfo userInfo) {
+        this.userInfo = userInfo;
+    }
+}


Mime
View raw message