mirror of
https://github.com/bmlong137/alfresco-keycloak.git
synced 2025-05-12 21:24:43 +00:00
Consolidate projects / shaded dependencies
This commit is contained in:
parent
4ad55b7a77
commit
45721fcb53
4
.gitignore
vendored
4
.gitignore
vendored
@ -4,4 +4,6 @@ target/
|
||||
|
||||
.project
|
||||
.classpath
|
||||
dependency-reduced-pom.xml
|
||||
dependency-reduced-pom.xml
|
||||
alfresco.log
|
||||
share.log
|
@ -107,9 +107,10 @@ This module depends on the following projects / libraries:
|
||||
- keycloak-servlet-adapter-spi
|
||||
- keycloak-servlet-filter-adapter
|
||||
- keycloak-authz-client
|
||||
- [JBoss Logging](https://github.com/jboss-logging/jboss-logging) (Apache License, Version 2.0)
|
||||
- Acosix Alfresco Utility (Apache License, Version 2.0) - core extension
|
||||
|
||||
All Keycloak dependencies are aggregated into single uber-JAR / shaded dependency library for the Repository and Share respectively. This aggregation is handled via the sub-modules `repository-dependencies` and `share-dependencies`. This has been done to isolate this addon from whatever version of Keycloak libraries Alfresco pre-packages to support its `identity-service` authentication subsystem. These aggregated libraries are included in the respective AMPs of this project and only need to be installed separately if the simple JAR deployment method is used to install the modules of this addon.
|
||||
All Keycloak and JBoss dependencies are aggregated (shaded) directly into the module library for Repository and Share respectively. This has been done to isolate this addon from whatever version of Keycloak libraries Alfresco pre-packages to support its `identity-service` authentication subsystem.
|
||||
|
||||
The Acosix Alfresco Utility project provides the core extension for Alfresco Content Services as a separate artifact from the full module, which needs to be installed in Alfresco Content Services before the AMP of this project can be installed.
|
||||
|
||||
|
6
pom.xml
6
pom.xml
@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<groupId>de.acosix.alfresco.maven</groupId>
|
||||
<artifactId>de.acosix.alfresco.maven.project.parent-6.0.7</artifactId>
|
||||
<version>1.3.3</version>
|
||||
<version>1.3.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.acosix.alfresco.keycloak</groupId>
|
||||
@ -71,7 +71,7 @@
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
|
||||
<maven.shade.version>3.2.1</maven.shade.version>
|
||||
<maven.shade.version>3.2.4</maven.shade.version>
|
||||
|
||||
<keycloak.version>11.0.2</keycloak.version>
|
||||
<resteasy.version>3.13.0.Final</resteasy.version>
|
||||
@ -272,9 +272,7 @@
|
||||
</build>
|
||||
|
||||
<modules>
|
||||
<module>repository-dependencies</module>
|
||||
<module>repository</module>
|
||||
<module>share-dependencies</module>
|
||||
<module>share</module>
|
||||
</modules>
|
||||
</project>
|
@ -1,196 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
Copyright 2019 - 2020 Acosix GmbH
|
||||
|
||||
Licensed 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>de.acosix.alfresco.keycloak</groupId>
|
||||
<artifactId>de.acosix.alfresco.keycloak.parent</artifactId>
|
||||
<version>1.1.0-rc5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>de.acosix.alfresco.keycloak.repo.deps</artifactId>
|
||||
<name>Acosix Alfresco Keycloak - Repository Dependencies Module</name>
|
||||
<description>Aggregate (Uber-)JAR of all dependencies for the Acosix Alfresco Keycloak Repository Module</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-core</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-adapter-spi</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<!-- use default from Alfresco Repository -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcomponents-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-filter-adapter</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createSourcesJar>true</createSourcesJar>
|
||||
<shadeSourcesContent>true</shadeSourcesContent>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.keycloak</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.repo.deps.keycloak</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.jboss.logging</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.repo.deps.jboss.logging</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
|
||||
<addHeader>false</addHeader>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -50,12 +50,20 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}.deps</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-core</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
@ -65,6 +73,63 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-adapter-spi</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<!-- use default from Alfresco Repository -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcomponents-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-filter-adapter</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>de.acosix.alfresco.utility</groupId>
|
||||
<artifactId>de.acosix.alfresco.utility.core.repo</artifactId>
|
||||
@ -156,6 +221,91 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createSourcesJar>true</createSourcesJar>
|
||||
<shadeSourcesContent>true</shadeSourcesContent>
|
||||
<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.keycloak:*</include>
|
||||
<include>org.jboss.logging:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.keycloak</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.deps.keycloak</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.jboss.logging</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.deps.jboss.logging</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
|
||||
<addHeader>false</addHeader>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-shaded-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- need to exclude shaded class files from API validation -->
|
||||
<plugin>
|
||||
<groupId>de.thetaphi</groupId>
|
||||
<artifactId>forbiddenapis</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>de/acosix/alfresco/keycloak/deps/**/*.class</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<onlyAnalyze>de.acosix.alfresco.keycloak.repo.*</onlyAnalyze>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
@ -166,6 +316,19 @@
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- explicitly listed to be ordered after dependency + shade -->
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -1,53 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
Copyright 2019 - 2020 Acosix GmbH
|
||||
|
||||
Licensed 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.
|
||||
-->
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
<id>amp</id>
|
||||
<formats>
|
||||
<format>amp</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<componentDescriptors>
|
||||
<componentDescriptor>assemblies/amp-lib-component.xml</componentDescriptor>
|
||||
<componentDescriptor>assemblies/amp-config-component.xml</componentDescriptor>
|
||||
<componentDescriptor>assemblies/amp-messages-component.xml</componentDescriptor>
|
||||
<componentDescriptor>assemblies/amp-repo-webscript-component.xml</componentDescriptor>
|
||||
<componentDescriptor>assemblies/amp-surf-webscript-component.xml</componentDescriptor>
|
||||
<componentDescriptor>assemblies/amp-templates-component.xml</componentDescriptor>
|
||||
<componentDescriptor>assemblies/amp-webapp-component.xml</componentDescriptor>
|
||||
</componentDescriptors>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<includes>
|
||||
<include>*.properties</include>
|
||||
</includes>
|
||||
<filtered>true</filtered>
|
||||
<lineEnding>crlf</lineEnding>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<includes>
|
||||
<include>${project.groupId}:${project.artifactId}.deps:*</include>
|
||||
</includes>
|
||||
<scope>compile</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
@ -19,8 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
|
||||
/**
|
||||
* Instances of this interface are used to map / extract authorities for an authenticated user from Keycloak authenticated users for use as
|
||||
|
@ -27,13 +27,13 @@ import java.util.stream.Stream;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessToken.Access;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken.Access;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import de.acosix.alfresco.keycloak.repo.roles.RoleNameFilter;
|
||||
import de.acosix.alfresco.keycloak.repo.roles.RoleNameMapper;
|
||||
|
||||
|
@ -20,9 +20,8 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.IDToken;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.IDToken;
|
||||
|
||||
/**
|
||||
* This user authentication mapping processor maps the default Alfresco person properties from an authenticated Keycloak user.
|
||||
|
@ -46,25 +46,25 @@ import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.keycloak.OAuth2Constants;
|
||||
import org.keycloak.adapters.KeycloakDeployment;
|
||||
import org.keycloak.adapters.ServerRequest;
|
||||
import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import org.keycloak.common.VerificationException;
|
||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||
import org.keycloak.constants.ServiceUrlConstants;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessTokenResponse;
|
||||
import org.keycloak.representations.IDToken;
|
||||
import org.keycloak.util.JsonSerialization;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.OAuth2Constants;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.KeycloakDeployment;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.ServerRequest;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.rotation.AdapterTokenVerifier;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.VerificationException;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.util.KeycloakUriBuilder;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.constants.ServiceUrlConstants;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessTokenResponse;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.IDToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.util.JsonSerialization;
|
||||
import de.acosix.alfresco.keycloak.repo.util.AlfrescoCompatibilityUtil;
|
||||
import de.acosix.alfresco.keycloak.repo.util.RefreshableAccessTokenHolder;
|
||||
import net.sf.acegisecurity.Authentication;
|
||||
|
@ -49,6 +49,23 @@ import org.alfresco.util.PropertyCheck;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.keycloak.KeycloakSecurityContext;
|
||||
import org.keycloak.adapters.AdapterDeploymentContext;
|
||||
import org.keycloak.adapters.AuthenticatedActionsHandler;
|
||||
import org.keycloak.adapters.KeycloakDeployment;
|
||||
import org.keycloak.adapters.OidcKeycloakAccount;
|
||||
import org.keycloak.adapters.PreAuthActionsHandler;
|
||||
import org.keycloak.adapters.RefreshableKeycloakSecurityContext;
|
||||
import org.keycloak.adapters.servlet.FilterRequestAuthenticator;
|
||||
import org.keycloak.adapters.servlet.OIDCFilterSessionStore;
|
||||
import org.keycloak.adapters.servlet.OIDCServletHttpFacade;
|
||||
import org.keycloak.adapters.spi.AuthOutcome;
|
||||
import org.keycloak.adapters.spi.AuthenticationError;
|
||||
import org.keycloak.adapters.spi.KeycloakAccount;
|
||||
import org.keycloak.adapters.spi.SessionIdMapper;
|
||||
import org.keycloak.adapters.spi.UserSessionManagement;
|
||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@ -56,23 +73,6 @@ import org.springframework.extensions.webscripts.Description.RequiredAuthenticat
|
||||
import org.springframework.extensions.webscripts.Match;
|
||||
import org.springframework.extensions.webscripts.RuntimeContainer;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.KeycloakSecurityContext;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.AdapterDeploymentContext;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.AuthenticatedActionsHandler;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.KeycloakDeployment;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.OidcKeycloakAccount;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.PreAuthActionsHandler;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.RefreshableKeycloakSecurityContext;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.servlet.FilterRequestAuthenticator;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.servlet.OIDCFilterSessionStore;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.servlet.OIDCServletHttpFacade;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.AuthOutcome;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.AuthenticationError;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.KeycloakAccount;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.SessionIdMapper;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.UserSessionManagement;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.util.KeycloakUriBuilder;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.util.AlfrescoCompatibilityUtil;
|
||||
import de.acosix.alfresco.keycloak.repo.util.RefreshableAccessTokenHolder;
|
||||
|
||||
|
@ -17,8 +17,7 @@ package de.acosix.alfresco.keycloak.repo.authentication;
|
||||
|
||||
import org.alfresco.repo.web.auth.WebCredentials;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
|
||||
/**
|
||||
* @author Axel Faust
|
||||
|
@ -26,15 +26,14 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.external.RemoteUserMapper;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.keycloak.adapters.BearerTokenRequestAuthenticator;
|
||||
import org.keycloak.adapters.KeycloakDeployment;
|
||||
import org.keycloak.adapters.spi.AuthOutcome;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.BearerTokenRequestAuthenticator;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.KeycloakDeployment;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.AuthOutcome;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
|
||||
/**
|
||||
* @author Axel Faust
|
||||
*/
|
||||
|
@ -26,9 +26,8 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.servlet.ServletHttpFacade;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.HttpFacade;
|
||||
import org.keycloak.adapters.servlet.ServletHttpFacade;
|
||||
import org.keycloak.adapters.spi.HttpFacade;
|
||||
|
||||
/**
|
||||
* This {@link HttpFacade} wraps servlet requests and responses in such a way that any response headers / cookies being set by Keycloak
|
||||
|
@ -21,10 +21,9 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.keycloak.adapters.spi.SessionIdMapper;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.spi.SessionIdMapper;
|
||||
|
||||
/**
|
||||
* @author Axel Faust
|
||||
*/
|
||||
|
@ -19,9 +19,8 @@ import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.IDToken;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.IDToken;
|
||||
|
||||
/**
|
||||
* Instances of this interface are used to map data from Keycloak authenticated users to the Alfresco person node. All instances of this
|
||||
|
@ -17,10 +17,10 @@ package de.acosix.alfresco.keycloak.repo.client;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.ClientRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.RoleRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.ClientRepresentation;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.RoleRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this interface wrap the relevant Keycloak admin ReST API for the synchronisation of users, groups and roles from a Keycloak
|
||||
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package de.acosix.alfresco.keycloak.repo.client;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MappingIterator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
@ -37,29 +40,26 @@ import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.keycloak.OAuth2Constants;
|
||||
import org.keycloak.adapters.KeycloakDeployment;
|
||||
import org.keycloak.adapters.ServerRequest;
|
||||
import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier;
|
||||
import org.keycloak.common.VerificationException;
|
||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||
import org.keycloak.common.util.Time;
|
||||
import org.keycloak.constants.ServiceUrlConstants;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessTokenResponse;
|
||||
import org.keycloak.representations.idm.ClientRepresentation;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.RoleRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.util.JsonSerialization;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MappingIterator;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.OAuth2Constants;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.KeycloakDeployment;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.ServerRequest;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.rotation.AdapterTokenVerifier;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.VerificationException;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.util.KeycloakUriBuilder;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.util.Time;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.constants.ServiceUrlConstants;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessTokenResponse;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.ClientRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.RoleRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.util.JsonSerialization;
|
||||
import de.acosix.alfresco.keycloak.repo.util.RefreshableAccessTokenHolder;
|
||||
|
||||
/**
|
||||
|
@ -28,13 +28,13 @@ import java.util.regex.Pattern;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.keycloak.representations.idm.RoleRepresentation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.client.IDMClient;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.RoleRepresentation;
|
||||
|
||||
public class RoleServiceImpl implements InitializingBean, RoleService
|
||||
{
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package de.acosix.alfresco.keycloak.repo.spring;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
@ -31,6 +33,7 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
@ -38,10 +41,6 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.config.PlaceholderConfigurerSupport;
|
||||
import org.springframework.util.PropertyPlaceholderHelper;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
|
||||
/**
|
||||
* @author Axel Faust
|
||||
*/
|
||||
|
@ -27,14 +27,13 @@ import org.apache.http.conn.params.ConnRoutePNames;
|
||||
import org.apache.http.conn.params.ConnRouteParams;
|
||||
import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.keycloak.adapters.HttpClientBuilder;
|
||||
import org.keycloak.adapters.KeycloakDeployment;
|
||||
import org.keycloak.adapters.KeycloakDeploymentBuilder;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.HttpClientBuilder;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.KeycloakDeployment;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.KeycloakDeploymentBuilder;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
|
||||
/**
|
||||
* @author Axel Faust
|
||||
*/
|
||||
|
@ -19,8 +19,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.sync.NodeDescription;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
|
||||
/**
|
||||
* This group synchronisation mapping processor maps the default Alfresco authority container properties from a Keycloak group.
|
||||
|
@ -23,8 +23,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.sync.NodeDescription;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* This user synchronisation mapping processor maps the default Alfresco person properties from a Keycloak user.
|
||||
|
@ -19,11 +19,10 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
|
||||
/**
|
||||
* This class provides filter capabilities for groups to be synchronised based on their parent group and whether they are contained in
|
||||
* specific groups.
|
||||
|
@ -18,12 +18,11 @@ package de.acosix.alfresco.keycloak.repo.sync;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* This class provides filter capabilities for users to be synchronised based on the groups they are a member of and whether they are
|
||||
* contained in specific groups.
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package de.acosix.alfresco.keycloak.repo.sync;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this interface are used to determine which groups should be synchronised. All instances of this interface in the Keycloak
|
||||
|
@ -16,8 +16,7 @@
|
||||
package de.acosix.alfresco.keycloak.repo.sync;
|
||||
|
||||
import org.alfresco.repo.security.sync.NodeDescription;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this interface are to map data from Keycloak groups to the Alfresco authority container node description. All instances of
|
||||
|
@ -36,6 +36,8 @@ import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@ -44,8 +46,6 @@ import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.client.IDMClient;
|
||||
import de.acosix.alfresco.keycloak.repo.client.IDMClientImpl;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* This class provides a Keycloak-based user registry to support synchronisation with Keycloak managed users and groups.
|
||||
|
@ -16,8 +16,7 @@
|
||||
package de.acosix.alfresco.keycloak.repo.sync;
|
||||
|
||||
import org.alfresco.repo.security.sync.NodeDescription;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.GroupRepresentation;
|
||||
import org.keycloak.representations.idm.GroupRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this class perform simple mappings from Keycloak group attributes to authority container node description properties.
|
||||
|
@ -21,8 +21,7 @@ import java.util.HashSet;
|
||||
|
||||
import org.alfresco.repo.security.sync.NodeDescription;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this class perform simple mappings from Keycloak user attributes to person node description properties.
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package de.acosix.alfresco.keycloak.repo.sync;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this interface are used to determine which users should be synchronised. All instances of this interface in the Keycloak
|
||||
|
@ -19,8 +19,7 @@ import java.util.Collection;
|
||||
|
||||
import org.alfresco.repo.security.sync.NodeDescription;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
|
||||
/**
|
||||
* Instances of this interface are used to map data from Keycloak users to the Alfresco person node description. All instances of this
|
||||
|
@ -18,12 +18,11 @@ package de.acosix.alfresco.keycloak.repo.util;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.common.util.Time;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.AccessTokenResponse;
|
||||
import de.acosix.alfresco.keycloak.repo.deps.keycloak.representations.IDToken;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import org.keycloak.common.util.Time;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessTokenResponse;
|
||||
import org.keycloak.representations.IDToken;
|
||||
|
||||
/**
|
||||
* Instances of this class encapsulate a potentially refreshable access token.
|
||||
|
@ -1,195 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!--
|
||||
Copyright 2019 - 2020 Acosix GmbH
|
||||
|
||||
Licensed 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>de.acosix.alfresco.keycloak</groupId>
|
||||
<artifactId>de.acosix.alfresco.keycloak.parent</artifactId>
|
||||
<version>1.1.0-rc5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>de.acosix.alfresco.keycloak.share.deps</artifactId>
|
||||
<name>Acosix Alfresco Keycloak - Share Dependencies Module</name>
|
||||
<description>Aggregate (Uber-)JAR of all dependencies for the Acosix Alfresco Keycloak Share Module (except BouncyCastle)</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-core</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-adapter-spi</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<!-- use default from Alfresco Share -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcomponents-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-filter-adapter</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-authz-client</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createSourcesJar>true</createSourcesJar>
|
||||
<shadeSourcesContent>true</shadeSourcesContent>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.keycloak</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.share.deps.keycloak</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.fasterxml.jackson</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.share.deps.jackson</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.jboss.logging</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.share.deps.jboss.logging</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
|
||||
<addHeader>false</addHeader>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
163
share/pom.xml
163
share/pom.xml
@ -65,12 +65,64 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}.deps</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-core</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-adapter-spi</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<!-- use default from Alfresco Share -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcomponents-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-servlet-filter-adapter</artifactId>
|
||||
<exclusions>
|
||||
<!-- don't include activation standalone JAR - rely on JDK inclusion since Java 6 -->
|
||||
<exclusion>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-authz-client</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
@ -217,6 +269,96 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createSourcesJar>true</createSourcesJar>
|
||||
<shadeSourcesContent>true</shadeSourcesContent>
|
||||
<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.keycloak:*</include>
|
||||
<include>com.fasterxml.jackson.core:*</include>
|
||||
<include>org.jboss.logging:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.keycloak</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.deps.keycloak</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.fasterxml.jackson</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.deps.jackson</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.jboss.logging</pattern>
|
||||
<shadedPattern>de.acosix.alfresco.keycloak.deps.jboss.logging</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
|
||||
<addHeader>false</addHeader>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-shaded-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- need to exclude shaded class files from API validation -->
|
||||
<plugin>
|
||||
<groupId>de.thetaphi</groupId>
|
||||
<artifactId>forbiddenapis</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>de/acosix/alfresco/keycloak/deps/**/*.class</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<onlyAnalyze>de.acosix.alfresco.keycloak.share.*</onlyAnalyze>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
@ -232,6 +374,19 @@
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- explicitly listed to be ordered after dependency + shade -->
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
@ -46,7 +46,6 @@
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<includes>
|
||||
<include>org.bouncycastle:*</include>
|
||||
<include>${project.groupId}:${project.artifactId}.deps:*</include>
|
||||
</includes>
|
||||
<scope>compile</scope>
|
||||
</dependencySet>
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package de.acosix.alfresco.keycloak.share.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
@ -32,12 +34,11 @@ import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.extensions.config.ConfigElement;
|
||||
|
||||
import de.acosix.alfresco.keycloak.share.deps.jackson.annotation.JsonProperty;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import de.acosix.alfresco.utility.share.config.BaseCustomConfigElement;
|
||||
import de.acosix.alfresco.utility.share.config.ConfigValueHolder;
|
||||
|
||||
|
@ -20,6 +20,9 @@ import java.util.Collections;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.alfresco.web.site.servlet.SlingshotAlfrescoConnector;
|
||||
import org.keycloak.KeycloakSecurityContext;
|
||||
import org.keycloak.adapters.OidcKeycloakAccount;
|
||||
import org.keycloak.adapters.spi.KeycloakAccount;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.extensions.config.RemoteConfigElement.ConnectorDescriptor;
|
||||
@ -27,9 +30,6 @@ import org.springframework.extensions.surf.ServletUtil;
|
||||
import org.springframework.extensions.webscripts.connector.ConnectorContext;
|
||||
import org.springframework.extensions.webscripts.connector.RemoteClient;
|
||||
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.KeycloakSecurityContext;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.OidcKeycloakAccount;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.KeycloakAccount;
|
||||
import de.acosix.alfresco.keycloak.share.util.RefreshableAccessTokenHolder;
|
||||
import de.acosix.alfresco.keycloak.share.web.KeycloakAuthenticationFilter;
|
||||
import de.acosix.alfresco.utility.share.connector.MutableSlingshotRemoteClient;
|
||||
|
@ -18,12 +18,11 @@ package de.acosix.alfresco.keycloak.share.util;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.common.util.Time;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.AccessTokenResponse;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.IDToken;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import org.keycloak.common.util.Time;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessTokenResponse;
|
||||
import org.keycloak.representations.IDToken;
|
||||
|
||||
/**
|
||||
* Instances of this class encapsulate a potentially refreshable access token.
|
||||
|
@ -25,18 +25,18 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import org.keycloak.adapters.spi.InMemorySessionIdMapper;
|
||||
import org.keycloak.adapters.spi.SessionIdMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.extensions.config.ConfigService;
|
||||
|
||||
import de.acosix.alfresco.keycloak.share.config.KeycloakAuthenticationConfigElement;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.InMemorySessionIdMapper;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.SessionIdMapper;
|
||||
|
||||
/**
|
||||
* This implementation of a {@link SessionIdMapper Keycloak session ID mapper} is based on the {@link InMemorySessionIdMapper in-memory
|
||||
* mapper}, but uses a better model for synchronization and respects configured size limits, ejecting least-recently active sessions first.
|
||||
* mapper}, but uses a better model for synchronisation and respects configured size limits, ejecting least-recently active sessions first.
|
||||
* Activity of session with regards to being determined the "least-recently active" session is based upon validation calls to
|
||||
* {@link #hasSession(String) hasSession}.
|
||||
*
|
||||
|
@ -59,6 +59,39 @@ import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.keycloak.KeycloakSecurityContext;
|
||||
import org.keycloak.OAuth2Constants;
|
||||
import org.keycloak.TokenVerifier;
|
||||
import org.keycloak.adapters.AdapterDeploymentContext;
|
||||
import org.keycloak.adapters.AuthenticatedActionsHandler;
|
||||
import org.keycloak.adapters.BearerTokenRequestAuthenticator;
|
||||
import org.keycloak.adapters.HttpClientBuilder;
|
||||
import org.keycloak.adapters.KeycloakDeployment;
|
||||
import org.keycloak.adapters.KeycloakDeploymentBuilder;
|
||||
import org.keycloak.adapters.OAuthRequestAuthenticator;
|
||||
import org.keycloak.adapters.OIDCAuthenticationError;
|
||||
import org.keycloak.adapters.OidcKeycloakAccount;
|
||||
import org.keycloak.adapters.PreAuthActionsHandler;
|
||||
import org.keycloak.adapters.ServerRequest;
|
||||
import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier;
|
||||
import org.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import org.keycloak.adapters.servlet.FilterRequestAuthenticator;
|
||||
import org.keycloak.adapters.servlet.OIDCFilterSessionStore;
|
||||
import org.keycloak.adapters.servlet.OIDCServletHttpFacade;
|
||||
import org.keycloak.adapters.spi.AuthOutcome;
|
||||
import org.keycloak.adapters.spi.AuthenticationError;
|
||||
import org.keycloak.adapters.spi.KeycloakAccount;
|
||||
import org.keycloak.adapters.spi.SessionIdMapper;
|
||||
import org.keycloak.adapters.spi.UserSessionManagement;
|
||||
import org.keycloak.common.VerificationException;
|
||||
import org.keycloak.common.util.KeycloakUriBuilder;
|
||||
import org.keycloak.common.util.Time;
|
||||
import org.keycloak.constants.ServiceUrlConstants;
|
||||
import org.keycloak.representations.AccessToken;
|
||||
import org.keycloak.representations.AccessTokenResponse;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.keycloak.util.JsonSerialization;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@ -89,39 +122,6 @@ import org.springframework.extensions.webscripts.servlet.DependencyInjectedFilte
|
||||
import de.acosix.alfresco.keycloak.share.config.KeycloakAdapterConfigElement;
|
||||
import de.acosix.alfresco.keycloak.share.config.KeycloakAuthenticationConfigElement;
|
||||
import de.acosix.alfresco.keycloak.share.config.KeycloakConfigConstants;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.KeycloakSecurityContext;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.OAuth2Constants;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.TokenVerifier;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.AdapterDeploymentContext;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.AuthenticatedActionsHandler;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.BearerTokenRequestAuthenticator;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.HttpClientBuilder;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.KeycloakDeployment;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.KeycloakDeploymentBuilder;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.OAuthRequestAuthenticator;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.OIDCAuthenticationError;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.OidcKeycloakAccount;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.PreAuthActionsHandler;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.ServerRequest;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.authentication.ClientCredentialsProviderUtils;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.rotation.AdapterTokenVerifier;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.rotation.AdapterTokenVerifier.VerifiedTokens;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.servlet.FilterRequestAuthenticator;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.servlet.OIDCFilterSessionStore;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.servlet.OIDCServletHttpFacade;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.AuthOutcome;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.AuthenticationError;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.KeycloakAccount;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.SessionIdMapper;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.UserSessionManagement;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.common.VerificationException;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.common.util.KeycloakUriBuilder;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.common.util.Time;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.constants.ServiceUrlConstants;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.AccessToken;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.AccessTokenResponse;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.util.JsonSerialization;
|
||||
import de.acosix.alfresco.keycloak.share.remote.AccessTokenAwareSlingshotAlfrescoConnector;
|
||||
import de.acosix.alfresco.keycloak.share.util.RefreshableAccessTokenHolder;
|
||||
|
||||
@ -1474,6 +1474,10 @@ public class KeycloakAuthenticationFilter implements DependencyInjectedFilter, I
|
||||
* Checks if the backend requires HTTP Basic or Keycloak authentication for the current request context, which may include an externally
|
||||
* authenticated user.
|
||||
*
|
||||
* @param req
|
||||
* the request to check
|
||||
* @param session
|
||||
* the active session managing any persistent access token state
|
||||
* @return {@code true} if the backend requires HTTP Basic or Keycloak authentication, {@code false} otherwise
|
||||
*/
|
||||
protected boolean isBackendRequiringBasicOrKeycloakAuthentication(final HttpServletRequest req, final HttpSession session)
|
||||
@ -1678,6 +1682,8 @@ public class KeycloakAuthenticationFilter implements DependencyInjectedFilter, I
|
||||
* @param session
|
||||
* the active session managing any persistent access token state
|
||||
* @return the response to obtaining the access token for the Alfresco backend
|
||||
* @throws IOException
|
||||
* if any error occurs calling Keycloak to exchange the access token
|
||||
*/
|
||||
protected AccessTokenResponse getAccessToken(final String alfrescoResourceName, final HttpSession session) throws IOException
|
||||
{
|
||||
|
@ -26,9 +26,8 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.servlet.ServletHttpFacade;
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.adapters.spi.HttpFacade;
|
||||
import org.keycloak.adapters.servlet.ServletHttpFacade;
|
||||
import org.keycloak.adapters.spi.HttpFacade;
|
||||
|
||||
/**
|
||||
* This {@link HttpFacade} wraps servlet requests and responses in such a way that any response headers / cookies being set by Keycloak
|
||||
|
@ -20,14 +20,13 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.keycloak.representations.adapters.config.AdapterConfig;
|
||||
import org.springframework.extensions.config.Config;
|
||||
import org.springframework.extensions.config.ConfigElement;
|
||||
import org.springframework.extensions.config.ConfigSource;
|
||||
import org.springframework.extensions.config.source.UrlConfigSource;
|
||||
import org.springframework.extensions.config.xml.XMLConfigService;
|
||||
|
||||
import de.acosix.alfresco.keycloak.share.deps.keycloak.representations.adapters.config.AdapterConfig;
|
||||
|
||||
/**
|
||||
* @author Axel Faust
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user