This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/master by this push: new a0d634c Fixing name of package and use of property instead of constant a0d634c is described below commit a0d634ce83923cb83eda614adf50cce064544cea Author: JiriOndrusek <ondrusek.j...@gmail.com> AuthorDate: Wed May 6 11:24:45 2020 +0200 Fixing name of package and use of property instead of constant --- .../spring/boot/UndertowSpringSecurityAutoConfiguration.java | 7 +++---- .../undertow/spring/boot/UndertowSpringSecurityConfiguration.java | 4 ++-- .../spring/boot/providers/AbstractProviderConfiguration.java | 4 +++- .../spring/boot/providers/KeycloakProviderConfiguration.java | 3 ++- .../camel/{example => }/undertow/spring/boot/Application.java | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/UndertowSpringSecurityAutoConfiguration.java b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/UndertowSpringSecurityAutoConfiguration.java similarity index 95% rename from components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/UndertowSpringSecurityAutoConfiguration.java rename to components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/UndertowSpringSecurityAutoConfiguration.java index 064ca82..fe503fe 100644 --- a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/UndertowSpringSecurityAutoConfiguration.java +++ b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/UndertowSpringSecurityAutoConfiguration.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.example.undertow.spring.boot; +package org.apache.camel.undertow.spring.boot; import org.apache.camel.component.spring.security.SpringSecurityConfiguration; import org.apache.camel.component.spring.security.keycloak.KeycloakUsernameSubClaimAdapter; import org.apache.camel.component.undertow.UndertowComponent; -import org.apache.camel.example.undertow.spring.boot.providers.AbstractProviderConfiguration; +import org.apache.camel.undertow.spring.boot.providers.AbstractProviderConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -88,8 +88,7 @@ public class UndertowSpringSecurityAutoConfiguration { public JwtDecoder jwtDecoderByIssuerUri() { final String jwkSetUri = getClientRegistration().getProviderDetails().getJwkSetUri(); final NimbusJwtDecoder jwtDecoder = NimbusJwtDecoder.withJwkSetUri(jwkSetUri).build(); - // Use preferred_username from claims as authentication name, instead of UUID subject - jwtDecoder.setClaimSetConverter(new KeycloakUsernameSubClaimAdapter("preferred_username")); + jwtDecoder.setClaimSetConverter(new KeycloakUsernameSubClaimAdapter(getProvider().getUserNameAttribute()));; return jwtDecoder; } diff --git a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/UndertowSpringSecurityConfiguration.java b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/UndertowSpringSecurityConfiguration.java similarity index 92% rename from components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/UndertowSpringSecurityConfiguration.java rename to components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/UndertowSpringSecurityConfiguration.java index 5fa790f..0858dbf 100644 --- a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/UndertowSpringSecurityConfiguration.java +++ b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/UndertowSpringSecurityConfiguration.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.example.undertow.spring.boot; +package org.apache.camel.undertow.spring.boot; import org.apache.camel.component.undertow.UndertowComponent; -import org.apache.camel.example.undertow.spring.boot.providers.KeycloakProviderConfiguration; +import org.apache.camel.undertow.spring.boot.providers.KeycloakProviderConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/providers/AbstractProviderConfiguration.java b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/providers/AbstractProviderConfiguration.java similarity index 93% rename from components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/providers/AbstractProviderConfiguration.java rename to components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/providers/AbstractProviderConfiguration.java index 2560571..468e95b4 100644 --- a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/providers/AbstractProviderConfiguration.java +++ b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/providers/AbstractProviderConfiguration.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.example.undertow.spring.boot.providers; +package org.apache.camel.undertow.spring.boot.providers; import org.springframework.core.convert.converter.Converter; import org.springframework.security.authentication.AbstractAuthenticationToken; @@ -36,6 +36,8 @@ public abstract class AbstractProviderConfiguration { public abstract ClientRegistration getClientRegistration() throws URISyntaxException; + public abstract String getUserNameAttribute(); + public Converter<Jwt, ? extends AbstractAuthenticationToken> getJwtAuthenticationConverter() { throw new IllegalArgumentException("Not implemented"); } diff --git a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/providers/KeycloakProviderConfiguration.java b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/providers/KeycloakProviderConfiguration.java similarity index 98% rename from components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/providers/KeycloakProviderConfiguration.java rename to components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/providers/KeycloakProviderConfiguration.java index f76c704..6b00cbe 100644 --- a/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/example/undertow/spring/boot/providers/KeycloakProviderConfiguration.java +++ b/components-starter/camel-undertow-spring-security-starter/src/main/java/org/apache/camel/undertow/spring/boot/providers/KeycloakProviderConfiguration.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.example.undertow.spring.boot.providers; +package org.apache.camel.undertow.spring.boot.providers; import org.apache.camel.component.spring.security.keycloak.KeycloakJwtAuthenticationConverter; import org.springframework.core.convert.converter.Converter; @@ -99,6 +99,7 @@ public class KeycloakProviderConfiguration extends AbstractProviderConfiguration this.realmId = realmId; } + @Override public String getUserNameAttribute() { return userNameAttribute; } diff --git a/examples/camel-example-spring-boot-undertow-spring-security/src/main/java/org/apache/camel/example/undertow/spring/boot/Application.java b/examples/camel-example-spring-boot-undertow-spring-security/src/main/java/org/apache/camel/undertow/spring/boot/Application.java similarity index 96% rename from examples/camel-example-spring-boot-undertow-spring-security/src/main/java/org/apache/camel/example/undertow/spring/boot/Application.java rename to examples/camel-example-spring-boot-undertow-spring-security/src/main/java/org/apache/camel/undertow/spring/boot/Application.java index 134c8a0..7b54852 100644 --- a/examples/camel-example-spring-boot-undertow-spring-security/src/main/java/org/apache/camel/example/undertow/spring/boot/Application.java +++ b/examples/camel-example-spring-boot-undertow-spring-security/src/main/java/org/apache/camel/undertow/spring/boot/Application.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.example.undertow.spring.boot; +package org.apache.camel.undertow.spring.boot; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.spring.security.SpringSecurityProvider;