我已经创建了一个通配符容器(通配符25.0.1和keycloak 15.0.2),并将keycloak作为子系统。我也有一个正在运行的钥匙斗篷容器。试图使用web.xml部署一个简单的雅加达应用程序(通过maven构建为war并将其上传到通配符中),如下所示:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"demo1-1.0-
SNAPSHOT.war\".undertow-deployment" => "java.lang.RuntimeException:
java.lang.IllegalStateException: The required mechanism 'KEYCLOAK' is not available
in mechanisms [BASIC, CLIENT_CERT, DIGEST, FORM] from the HttpAuthenticationFactory.
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: The
required mechanism 'KEYCLOAK' is not available in mechanisms [BASIC, CLIENT_CERT,
DIGEST, FORM] from the HttpAuthenticationFactory.
Caused by: java.lang.IllegalStateException: The required mechanism 'KEYCLOAK' is
not available in mechanisms [BASIC, CLIENT_CERT, DIGEST, FORM] from the
HttpAuthenticationFactory."}}
我在WEB下的web.xml:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<module-name>demo</module-name>
<security-constraint>
<web-resource-collection>
<web-resource-name>Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>KEYCLOAK</auth-method>
<realm-name>my-auth</realm-name>
</login-config>
<security-role>
<role-name>user</role-name>
</security-role>
</web-app>
我的野蝇码头文件:
FROM jboss/wildfly:25.0.0.Final
ENV KEYCLOAK_VERSION 15.0.2
ENV WILDFLY_HOME /opt/jboss/wildfly
RUN cd $WILDFLY_HOME && curl -LO https://github.com/keycloak/keycloak/releases/download/${KEYCLOAK_VERSION}/keycloak-oidc-wildfly-adapter-${KEYCLOAK_VERSION}.tar.gz \
&& tar -xzvf keycloak-oidc-wildfly-adapter-${KEYCLOAK_VERSION}.tar.gz \
&& rm keycloak-oidc-wildfly-adapter-${KEYCLOAK_VERSION}.tar.gz \
&& bin/jboss-cli.sh --file=bin/adapter-elytron-install-offline.cli \
# Admin-User anlegen
&& bin/add-user.sh admin admin1234 --silent \
# Zu Vermeidung von Fehlermeldungen beim Start
&& rm -r standalone/configuration/standalone_xml_history/current/
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
EXPOSE 8285
EXPOSE 9992
打开浏览器中的通配符-> confguration ->subsystem向我展示了键盘斗篷的存在。在通配符容器的thestandalone.xml文件中,我可以看到设置了以下内容:
<http-authentication-factory name="keycloak-http-authentication" security-domain="KeycloakDomain" http-server-mechanism-factory="keycloak-http-server-mechanism-factory">
<mechanism-configuration>
<mechanism mechanism-name="KEYCLOAK">
<mechanism-realm realm-name="KeycloakOIDCRealm" realm-mapper="keycloak-oidc-realm-mapper"/>
</mechanism>
</mechanism-configuration>
</http-authentication-factory>
该应用程序在WEB中也有keyclaock.json。知道怎么解决这个问题吗?
发布于 2022-01-10 16:50:43
Keycloak已经放弃了野生苍蝇适配器,而支持在Elytron中构建的认证器。https://www.keycloak.org/2021/12/keycloak-1510-released
您可以检查这是否符合您的要求,或坚持野生苍蝇24目前。
有关使用Elytron内置身份验证的更多信息,请参见https://wildfly-security.github.io/wildfly-elytron/blog/securing-wildfly-apps-openid-connect/。
发布于 2022-01-21 14:29:20
不要安装适配器到野生苍蝇25或野生苍蝇26。使用通配符:elytron客户端:1.0配置方式。我的问题是一样的,但是当我进行配置时,我会得到403状态代码错误。如果更改为“野蝇23”,一切都会正常工作。
https://stackoverflow.com/questions/70001644
复制相似问题