2017-07-20 31 views
0

我正在关注keycloak documentation以使用wildfly适配器子系统来保护我的WAR。如何添加keycloak子系统以使用jboss-cli保护WAR

我尝试添加以下使用jboss-cli.sh -

<secure-deployment name="WAR MODULE NAME.war"> 
    <realm>bkofc</realm> 
    <auth-server-url>http://192.168.99.100:30001/auth</auth-server-url> 
    <bearer-only>true</bearer-only> 
    <ssl-required>EXTERNAL</ssl-required> 
    <resource>bkofc-svc</resource> 
    <credential name="secret">9bcc6d9f-9c72-4b58-b297-79f0f207d9e1</credential> 
    <use-resource-role-mappings>true</use-resource-role-mappings> 
</secure-deployment> 

然而,“证书”属性没有被承认:

[[email protected]:9990 /] 
/subsystem=keycloak/securedeployment=my.war/:add(realm=bkofc,auth-server- 
url=http://192.168.99.100/30001/auth, bearer-only=true, ssl- 
required=EXTERNAL, resource=bkofc-svc, use-resource-role-mappings=true, 
credential=9bcc6d9f-9c72-4b58-b297-79f0f207d9e1) 


'credential' is not found among the supported properties: [allow-any- 
hostname, always-refresh-token, auth-server-url, auth-server-url-for- 
backend-requests, autodetect-bearer-only, bearer-only, client-key-password, 
client-keystore, client-keystore-password, connection-pool-size, cors- 
allowed-headers, cors-allowed-methods, cors-max-age, disable-trust-manager, 
enable-basic-auth, enable-cors, expose-token, min-time-between-jwks- 
requests, principal-attribute, public-client, realm, realm-public-key, 
register-node-at-startup, register-node-period, resource, ssl-required, 
token-minimum-time-to-live, token-store, truststore, truststore-passw 
ord, turn-off-change-session-id-on-login, use-resource-role-mappings] 
[[email protected]:9990 /] 

没有凭据财产,其余均得到正确添加。

我该如何解决这个问题?

回答

0

你必须凭证位以后添加,你应该尝试这样的:

/subsystem=keycloak/securedeployment=my.war/:add(realm=bkofc,auth-server-url=http://192.168.99.100/30001/auth, bearer-only=true, ssl-required=EXTERNAL, resource=bkofc-svc, use-resource-role-mappings=true) 

/subsystem=keycloak/secure-deployment=my.war/credential=secret:add(value="9bcc6d9f-9c72-4b58-b297-79f0f207d9e1") 
+0

当然,我会尝试 – Rajesh