带有基于令牌的安全域的SOAP Web服务,使用密钥库

时间:2018-10-17 15:09:00

标签: web-services java-ee soap keycloak

我正在尝试将jwt令牌用于安全域角色管理。

@WebService
        (
                endpointInterface = "pro.eekeycloak.soap.Send",
                portName = "SendPort",
                name = "SendService",
                serviceName = "SendService",
                targetNamespace = "http://eekeycloak.pro/",
                wsdlLocation = "META-INF/wsdl/cat.wsdl"
        )
@Stateless
@SecurityDomain("keycloak")
public class SendPort implements Send {

    @WebMethod
    @RolesAllowed("user")
    public Cat getCat(){
        Cat cat = new Cat();
        cat.setName("Vasia");
        return cat;
    }
}

首先,我找到的是BinaryToken soap标头,在尝试使用InInterceptor之后,此方法不起作用。之后,我将令牌推入soap标头中,并使用公共密钥解码后可以得到它的用户和角色。最后:如何使Wildfly了解当前用户(角色),并在InInterceptor中执行以AllowRole(“ role”)注释的access或deny方法?

另一种方式是编写自定义登录模块,对此我一无所知:)

0 个答案:

没有答案