我的任务是使用密钥斗篷扩展/更改授权流程,并且可能在(https://www.keycloak.org/docs/latest/server_development/index.html#_auth_spi)上找到了有关它的一些信息。
我想做的第一件事是创建一个简单的项目,该项目可以让我在wildfly服务器上运行。但是,当我向pom.xml中添加一些依赖项时,我无法提供应该已经存在的依赖项(通过在maven项目中提供作用域)。我该如何提供? 我从官方网站下载了keycloak,并通过bin目录中的standalone.sh文件以独立模式运行。
我只是从一些教程中准备pom.xml,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.examples</groupId>
<artifactId>spi-custom</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Custom Saml Mapper</name>
<packaging>jar</packaging>
<parent>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>7.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi-private</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-saml-core-public</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>adam-saml-group-mapper</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
运行命令mvn clean install widlfy:deploy
显示错误消息:
Failed to execute goal on project spi-custom: Could not resolve dependencies for project com.examples:spi-custom:jar:1.0-SNAPSHOT:
The following artifacts could not be resolved: org.keycloak:keycloak-core:jar:1.0-SNAPSHOT,
org.keycloak:keycloak-server-spi:jar:1.0-SNAPSHOT,
org.keycloak:keycloak-server-spi-private:jar:1.0-SNAPSHOT,
org.keycloak:keycloak-services:jar:1.0-SNAPSHOT,
org.keycloak:keycloak-saml-core-public:jar:1.0-SNAPSHOT:
Xould not find artifact org.keycloak:keycloak-core:jar:1.0-SNAPSHOT
建立了一个依赖关系(jboss-logging),但其他任何依赖关系都无法解决。