You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2015/12/09 14:00:54 UTC
cxf-fediz git commit: Wiring in a Userinfo jaxrs endpoint
Repository: cxf-fediz
Updated Branches:
refs/heads/master 3eaac56a8 -> 143d17f29
Wiring in a Userinfo jaxrs endpoint
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/143d17f2
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/143d17f2
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/143d17f2
Branch: refs/heads/master
Commit: 143d17f299669d7dab1134229f48394b8c9c5205
Parents: 3eaac56
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Wed Dec 9 13:00:29 2015 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Wed Dec 9 13:00:29 2015 +0000
----------------------------------------------------------------------
services/oidc/pom.xml | 10 ++++-----
.../service/oidc/ClientRegistrationService.java | 2 +-
.../main/webapp/WEB-INF/applicationContext.xml | 23 +++++++++++++++++++-
3 files changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/143d17f2/services/oidc/pom.xml
----------------------------------------------------------------------
diff --git a/services/oidc/pom.xml b/services/oidc/pom.xml
index 9f47256..20d0fd3 100644
--- a/services/oidc/pom.xml
+++ b/services/oidc/pom.xml
@@ -56,15 +56,15 @@
<version>${cxf.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-extension-providers</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons.lang.version}</version>
- </dependency>
</dependencies>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/143d17f2/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
index c6ee4da..ec9cc73 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
@@ -36,8 +36,8 @@ import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.SecurityContext;
-import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.common.util.Base64UrlUtility;
+import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.rs.security.oauth2.common.Client;
import org.apache.cxf.rs.security.oauth2.common.UserSubject;
import org.apache.cxf.rt.security.crypto.CryptoUtils;
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/143d17f2/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
index 61cf6f4..2c41dd6 100644
--- a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
@@ -42,7 +42,6 @@
<property name="skipAuthorizationWithOidcScope" value="true"/>
<property name="canSupportPublicClients" value="true"/>
</bean>
- <bean id="oidcKeysService" class="org.apache.cxf.rs.security.oidc.idp.OidcKeysService"/>
<jaxrs:server address="/idp">
<jaxrs:serviceBeans>
<ref bean="oidcAuthorizationService"/>
@@ -56,6 +55,7 @@
Disable it if the client secret is used or if
pre-installing public OIDC keys to clients is preferred
-->
+ <bean id="oidcKeysService" class="org.apache.cxf.rs.security.oidc.idp.OidcKeysService"/>
<jaxrs:server address="/jwk">
<jaxrs:serviceBeans>
<ref bean="oidcKeysService"/>
@@ -69,6 +69,27 @@
</jaxrs:properties>
</jaxrs:server>
+
+ <bean id="oauth2TokenValidationFilter" class="org.apache.cxf.rs.security.oauth2.filters.OAuthRequestFilter">
+ <property name="dataProvider" ref="oauthProvider"/>
+ </bean>
+ <bean id="userInfoService" class="org.apache.cxf.rs.security.oidc.idp.UserInfoService">
+ <property name="oauthDataProvider" ref="oauthProvider"/>
+ </bean>
+ <jaxrs:server address="/users">
+ <jaxrs:serviceBeans>
+ <ref bean="userInfoService"/>
+ </jaxrs:serviceBeans>
+ <jaxrs:providers>
+ <bean class="org.apache.cxf.jaxrs.provider.json.JsonMapObjectProvider"/>
+ <ref bean="oauth2TokenValidationFilter"/>
+ </jaxrs:providers>
+ <jaxrs:properties>
+ <entry key="rs.security.signature.properties" value="rs.security.properties"/>
+ <entry key="rs.security.signature.key.password.provider" value-ref="keyPasswordProvider"/>
+ </jaxrs:properties>
+ </jaxrs:server>
+
<bean id="keyPasswordProvider" class="org.apache.cxf.fediz.service.oidc.PrivateKeyPasswordProviderImpl"/>
<bean id="clientRegService" init-method="init" class="org.apache.cxf.fediz.service.oidc.ClientRegistrationService">