尝试密钥隐藏身份验证时禁止403

时间:2020-11-04 14:00:41

标签: wildfly keycloak saml

我正在使用SAML迈出第一步,我在this guide之后使用Wildfly + Keycloak适配器攻击Docker Keycloak服务器。

我有一个打补丁的Wildfly-14.0.1.Final,已部署了helloworld.war,访问http:// localhost:8080 / helloworld将显示该页面。

我已经启动了密钥斗篷服务器,设置了HelloworldRealm和helloworld客户端(目前为openid-connect),根URL为http://localhost:8080/helloworld,有效重定向URI仅包含http://localhost:8080/helloworld/*

我获得了standalone.xml的安装代码,并将其复制到standalone.xml中:

    <subsystem xmlns="urn:jboss:domain:keycloak:1.1">
        <secure-deployment name="helloworld.war">
            <realm>helloworldRealm</realm>
            <resource>helloworld</resource>
            <auth-server-url>http://localhost:9080/auth/</auth-server-url>
            <ssl-required>EXTERNAL</ssl-required>
            <credential name="secret">e99f2281-5c39-4d36-9e38-3da104f0ac32</credential>
        </secure-deployment>
    </subsystem>

然后我修改战争的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="4.0"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">

    <welcome-file-list>
        <welcome-file>hola.html</welcome-file>
    </welcome-file-list>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>todo</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>KEYCLOAK</auth-method>
        <realm-name>HelloworldRealm</realm-name>
    </login-config>
</web-app>

Wildfly是14.0.1.Final,密钥克隆适配器和服务器都是11.0.2。

但是当我访问http:// localhost:8080 / helloworld时,我只收到403 Forbidden(没有任何重定向)。在我的Wildfly或Keycloak服务器上,日志均未显示任何内容。

我在做什么错了?

0 个答案:

没有答案