mirror of
https://github.com/bmlong137/keycloak-group-password-policy.git
synced 2025-09-10 22:21:07 +00:00
Add support to keycloak 18
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,3 +10,5 @@ pom.xml.versionsBackup
|
|||||||
# VS Code
|
# VS Code
|
||||||
.factorypath
|
.factorypath
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
**/.idea/**
|
@@ -1,5 +1,5 @@
|
|||||||
# keycloak-group-password-policy
|
# keycloak-group-password-policy
|
||||||
This keycloak extension (currenty developed and tested against version 6.0.1) aims to
|
This keycloak extension (currenty developed and tested against versions 6, 8-15, 18) aims to
|
||||||
create the possibility to assign additional password rules to user groups, extending the
|
create the possibility to assign additional password rules to user groups, extending the
|
||||||
rules attached to the realm, _not_ replacing them.
|
rules attached to the realm, _not_ replacing them.
|
||||||
|
|
||||||
@@ -8,7 +8,8 @@ It is available as a new type of password policy on the realm's password policy
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
The extension can be installed just like any keycloak extension. Either copy it to the
|
The extension can be installed just like any keycloak extension. Either copy it to the
|
||||||
`keycloak/standalone/deployments` folder, or load it via the jboss command line tool.
|
`keycloak/standalone/deployments` folder for JBoss deployments or in `keycloak/deployments`
|
||||||
|
for quarkus distributions, or load it via the jboss command line tool.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
There are multiple steps you will want to take to use this plugin. First, you need to determine
|
There are multiple steps you will want to take to use this plugin. First, you need to determine
|
||||||
|
73
pom.xml
73
pom.xml
@@ -12,7 +12,6 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
|
|
||||||
<keycloak.version>${keycloak.majorVersion}.0.0</keycloak.version>
|
<keycloak.version>${keycloak.majorVersion}.0.0</keycloak.version>
|
||||||
<auto-service.version>1.0</auto-service.version>
|
<auto-service.version>1.0</auto-service.version>
|
||||||
</properties>
|
</properties>
|
||||||
@@ -57,12 +56,12 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.4.2</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>3.6.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
@@ -71,15 +70,23 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<configuration>
|
<executions>
|
||||||
<classifier>keycloak-v${keycloak.majorVersion}</classifier>
|
<execution>
|
||||||
<archive>
|
<id>>keycloak-v${keycloak.majorVersion}</id>
|
||||||
<manifestEntries>
|
<goals>
|
||||||
<!-- This is required in order for the classloader of this JAR to access the specified library at runtime -->
|
<goal>jar</goal>
|
||||||
<Dependencies>org.keycloak.keycloak-services</Dependencies>
|
</goals>
|
||||||
</manifestEntries>
|
<configuration>
|
||||||
</archive>
|
<classifier>keycloak-v${keycloak.majorVersion}</classifier>
|
||||||
</configuration>
|
<archive>
|
||||||
|
<manifestEntries>
|
||||||
|
<!-- This is required in order for the classloader of this JAR to access the specified library at runtime -->
|
||||||
|
<Dependencies>org.keycloak.keycloak-services</Dependencies>
|
||||||
|
</manifestEntries>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
@@ -114,9 +121,6 @@
|
|||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>keycloak-v7</id>
|
<id>keycloak-v7</id>
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<properties>
|
<properties>
|
||||||
<keycloak.majorVersion>7</keycloak.majorVersion>
|
<keycloak.majorVersion>7</keycloak.majorVersion>
|
||||||
</properties>
|
</properties>
|
||||||
@@ -390,5 +394,44 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>keycloak-v18</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<keycloak.majorVersion>18</keycloak.majorVersion>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>add-source-keycloak-v18</id>
|
||||||
|
<goals><goal>add-source</goal></goals>
|
||||||
|
<configuration>
|
||||||
|
<sources>
|
||||||
|
<source>${basedir}/src/keycloak-v6-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v8-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v9-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v10-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v11-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v12-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v13-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v14-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v15-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v18-common/java</source>
|
||||||
|
<source>${basedir}/src/keycloak-v18/java</source>
|
||||||
|
</sources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -154,7 +154,7 @@ public abstract class FakeRealmV12 extends FakeRealmV11 {
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void patchRealmLocalizationTexts(String locale, Map<String, String> localizationTexts) {
|
public void patchRealmLocalizationTexts(String locale, Map<String, String> localizationTexts) {
|
||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ package com.github.jpicht.keycloak.policy;
|
|||||||
|
|
||||||
import org.keycloak.models.ParConfig;
|
import org.keycloak.models.ParConfig;
|
||||||
|
|
||||||
public class FakeRealmV15 extends FakeRealmV14 {
|
public abstract class FakeRealmV15 extends FakeRealmV14 {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParConfig getParPolicy() {
|
public ParConfig getParPolicy() {
|
||||||
|
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Brian Long (brian@inteligr8.com)
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.jpicht.keycloak.policy;
|
||||||
|
|
||||||
|
import org.keycloak.models.ParConfig;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class FakeRealmV18 extends FakeRealmV15 {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createOrUpdateRealmLocalizationTexts(String locale, Map<String, String> localizationTexts) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 Julian Picht
|
||||||
|
* Copyright 2021 Brian Long (brian@inteligr8.com)
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.jpicht.keycloak.policy;
|
||||||
|
|
||||||
|
import org.keycloak.models.PasswordPolicy;
|
||||||
|
|
||||||
|
public class FakeRealm extends FakeRealmV18 {
|
||||||
|
|
||||||
|
private PasswordPolicy passwordPolicy;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PasswordPolicy getPasswordPolicy() {
|
||||||
|
return passwordPolicy;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPasswordPolicy(PasswordPolicy policy) {
|
||||||
|
passwordPolicy = policy;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user