2017-07-20 39 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