{"id":16682,"date":"2025-04-18T23:07:34","date_gmt":"2025-04-18T15:07:34","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/16682.html"},"modified":"2025-04-18T23:07:34","modified_gmt":"2025-04-18T15:07:34","slug":"%e7%ac%ac2_3%e7%ab%a0_%e5%85%a5%e9%97%a8%e7%ae%a1%e7%90%86%e8%b5%84%e6%ba%90%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/16682.html","title":{"rendered":"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668"},"content":{"rendered":"<h2>\u5165\u95e8<\/h2>\n<p>\u5bf9\u4e8e\u67d0\u4e9b\u5e94\u7528\u7a0b\u5e8f&#xff0c;\u4f60\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u8d44\u6e90&#xff0c;\u5feb\u901f\u5f00\u59cb\u4f7f\u7528 Keycloak \u6388\u6743\u670d\u52a1&#xff1a;<\/p>\n<ul>\n<li>\u5728 Wildfly \u4e2d\u4fdd\u62a4 JakartaEE \u5e94\u7528\u7a0b\u5e8f&#xff08;https:\/\/github.com\/keycloak\/keycloak-quickstarts\/tree\/latest\/jakarta\/servlet-authz-client&#xff09;<\/li>\n<li>\u4fdd\u62a4 Spring Boot \u5e94\u7528\u7a0b\u5e8f&#xff08;https:\/\/github.com\/keycloak\/keycloak-quickstarts\/tree\/latest\/spring\/rest-authz-resource-server&#xff09;<\/li>\n<li>\u4fdd\u62a4 Quarkus \u5e94\u7528\u7a0b\u5e8f&#xff08;https:\/\/quarkus.io\/guides\/security-keycloak-authorization&#xff09;<\/li>\n<li>Keycloak Node.js \u9002\u914d\u5668&#xff08;https:\/\/www.keycloak.org\/securing-apps\/nodejs-adapter&#xff09;<\/li>\n<\/ul>\n<h2>\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668<\/h2>\n<p>\u6839\u636e OAuth2 \u89c4\u8303&#xff0c;\u8d44\u6e90\u670d\u52a1\u5668\u662f\u6258\u7ba1\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u670d\u52a1\u5668&#xff0c;\u80fd\u591f\u63a5\u53d7\u5e76\u54cd\u5e94\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u8bf7\u6c42\u3002<\/p>\n<p>\u5728 Keycloak \u4e2d&#xff0c;\u8d44\u6e90\u670d\u52a1\u5668\u4e3a\u5176\u53d7\u4fdd\u62a4\u8d44\u6e90\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e30\u5bcc\u7684\u5e73\u53f0&#xff0c;\u7528\u4e8e\u5b9e\u73b0\u7ec6\u7c92\u5ea6\u6388\u6743&#xff0c;\u6388\u6743\u51b3\u7b56\u53ef\u4ee5\u57fa\u4e8e\u4e0d\u540c\u7684\u8bbf\u95ee\u63a7\u5236\u673a\u5236\u505a\u51fa\u3002<\/p>\n<p>\u4efb\u4f55\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u90fd\u53ef\u4ee5\u914d\u7f6e\u4e3a\u652f\u6301\u7ec6\u7c92\u5ea6\u6743\u9650\u3002\u8fd9\u6837\u505a\u65f6&#xff0c;\u4ece\u6982\u5ff5\u4e0a\u8bb2&#xff0c;\u4f60\u6b63\u5728\u5c06\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u8f6c\u53d8\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u3002<\/p>\n<h3>\u521b\u5efa\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f<\/h3>\n<p>\u542f\u7528 Keycloak \u6388\u6743\u670d\u52a1\u7684\u7b2c\u4e00\u6b65\u662f\u521b\u5efa\u8981\u8f6c\u53d8\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u7684\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<li>\n<p>\u70b9\u51fb \u201cClients\u201d&#xff08;\u5ba2\u6237\u7aef&#xff09;\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150727-68026aafbc4b2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u5728\u9875\u9762\u4e0a\u70b9\u51fb \u201cCreate client\u201d&#xff08;\u521b\u5efa\u5ba2\u6237\u7aef&#xff09;\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150728-68026ab05a7fa.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u5ba2\u6237\u7aef\u7684 \u201cClient ID\u201d&#xff08;\u5ba2\u6237\u7aef ID&#xff09;&#xff0c;\u4f8b\u5982 \u201cmy-resource-server\u201d&#xff0c;\u7136\u540e\u70b9\u51fb \u201cNext\u201d&#xff08;\u4e0b\u4e00\u6b65&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 \u201cClient authentication\u201d&#xff08;\u5ba2\u6237\u7aef\u8ba4\u8bc1&#xff09;\u5207\u6362\u4e3a \u201cON\u201d&#xff0c;\u7136\u540e\u70b9\u51fb \u201cSave\u201d&#xff08;\u4fdd\u5b58&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u5e94\u7528\u7a0b\u5e8f\u7684 \u201cRoot URL\u201d&#xff08;\u6839 URL&#xff09;&#xff0c;\u4f8b\u5982 \u201chttp:\/\/{host}:{port}\/my-resource-server\u201d&#xff0c;\u7136\u540e\u70b9\u51fb \u201cSave\u201d&#xff08;\u4fdd\u5b58&#xff09;\u3002\u5ba2\u6237\u7aef\u521b\u5efa\u5b8c\u6210\u540e&#xff0c;\u5c06\u6253\u5f00\u5ba2\u6237\u7aef\u8bbe\u7f6e\u9875\u9762\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150728-68026ab0d1894.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<h3>\u542f\u7528\u6388\u6743\u670d\u52a1<\/h3>\n<p>\u4f60\u53ef\u4ee5\u5c06 OIDC \u5ba2\u6237\u7aef\u8f6c\u53d8\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u5e76\u542f\u7528\u7ec6\u7c92\u5ea6\u6388\u6743\u3002<\/p>\n<li>\n<p>\u5728\u5ba2\u6237\u7aef\u8bbe\u7f6e\u9875\u9762\u4e2d&#xff0c;\u5411\u4e0b\u6eda\u52a8\u5230 \u201cCapability Config\u201d&#xff08;\u529f\u80fd\u914d\u7f6e&#xff09;\u90e8\u5206\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 \u201cAuthorization Enabled\u201d&#xff08;\u542f\u7528\u6388\u6743&#xff09;\u5207\u6362\u4e3a \u201cOn\u201d&#xff0c;\u7136\u540e\u70b9\u51fb \u201cSave\u201d&#xff08;\u4fdd\u5b58&#xff09;\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150729-68026ab15ea15.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u6b64\u65f6&#xff0c;\u8be5\u5ba2\u6237\u7aef\u5c06\u663e\u793a\u4e00\u4e2a\u65b0\u7684 \u201cAuthorization\u201d&#xff08;\u6388\u6743&#xff09;\u9009\u9879\u5361\u3002\u70b9\u51fb\u8be5\u9009\u9879\u5361&#xff0c;\u5c06\u663e\u793a\u4e00\u4e2a\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u9875\u9762&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150729-68026ab1e6aeb.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<ul>\n<li>\n<p>Settings&#xff08;\u8bbe\u7f6e&#xff09;&#xff1a;\u8d44\u6e90\u670d\u52a1\u5668\u7684\u5e38\u89c4\u8bbe\u7f6e\u3002\u6709\u5173\u6b64\u9875\u9762\u7684\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f&#xff0c;\u8bf7\u53c2\u89c1 \u201c<\/p>\n<\/li>\n<li>\n<p>Resource&#xff08;\u8d44\u6e90&#xff09;&#xff1a;\u5728\u6b64\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u7ba1\u7406\u5e94\u7528\u7a0b\u5e8f\u7684\u8d44\u6e90\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5728Resources\u4e2d\u53ef\u4ee5\u7ef4\u62a4\u5e94\u7528\u7684\u53d7\u9650\u8bbf\u95ee\u8d44\u6e90&#xff0c;\u6240\u8c13\u7684\u201c\u7ec6\u7c92\u5ea6&#034;\u5373\u5bf9\u5e94\u5230\u6bcf\u4e2a\u8d44\u6e90\u3002\u4f7f\u7528\u8fc7Shiro\u7684\u540c\u5b66\u5e94\u8be5\u5bf9\u201c\u4fdd\u62a4\u8d44\u6e90\u201d\u7684\u6982\u5ff5\u4e0d\u964c\u751f&#xff0c;Shiro\u4e5f\u662f\u5c06\u5e94\u7528\u7684URL\u89c6\u4e3a\u8d44\u6e90\u3001\u5e76\u4f7f\u7528\u201c\u8d44\u6e90\u6807\u8bc6\u7b26:\u64cd\u4f5c:\u5bf9\u8c61\u5b9e\u4f8bID\u201c\u6765\u63cf\u8ff0\u6743\u9650&#xff0c;\u5728Keycloak\u4e2d\u4e5f\u53ef\u4ee5\u8d2f\u5f7b\u76f8\u540c\u7684\u7406\u5ff5\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u57fa\u4e8eURL\u6765\u521b\u5efa\u4e00\u4e2a\u8d44\u6e90:<\/p>\n<ul>\n<li>\n<p>Authorization Scopes&#xff08;\u6388\u6743\u4f5c\u7528\u57df&#xff09;&#xff1a;\u5728\u6b64\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u7ba1\u7406\u4f5c\u7528\u57df\u3002<\/p>\n<\/li>\n<li>\n<p>Policies&#xff08;\u7b56\u7565&#xff09;&#xff1a;\u5728\u6b64\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u7ba1\u7406\u6388\u6743\u7b56\u7565\u5e76\u5b9a\u4e49\u6388\u4e88\u6743\u9650\u65f6\u5fc5\u987b\u6ee1\u8db3\u7684\u6761\u4ef6\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u76f8\u8f83\u4e8e\u4f20\u7edf\u7684\u201c\u89d2\u8272-\u6743\u9650-\u8d44\u6e90\u201d\u7684RBAC\u6a21\u578b&#xff0c;Keycloak\u591a\u4e86\u4e00\u4e2a\u7b56\u7565\u7684\u6982\u5ff5\u6765\u9002\u914d\u4e0d\u540c\u7684\u6388\u6743\u5bf9\u8c61\u3002\u6743\u9650\u4e0d\u518d\u76f4\u63a5\u4e0e\u89d2\u8272\u5173\u8054&#xff0c;\u800c\u662f\u4e0e\u7b56\u7565\u5173\u8054&#xff1b;\u800c\u7b56\u7565\u9664\u4e86\u4e0e\u89d2\u8272\u5173\u8054&#xff0c;\u8fd8\u53ef\u4ee5\u4e0e\u5ba2\u6237\u7aef\u3001\u5206\u7ec4\u3001\u7528\u6237\u7b49\u5173\u8054&#xff0c;\u4ece\u800c\u5c06\u6240\u6709\u7684\u6388\u6743\u9700\u6c42\u90fd\u7edf\u4e00\u8d77\u6765&#xff0c;\u5373\u7b56\u7565\u5b9a\u4e49\u4e86\u6388\u4e88\u5bf9\u8c61\u8bbf\u95ee\u6743\u65f6\u5fc5\u987b\u6ee1\u8db3\u7684\u6761\u4ef6\u3002<\/p>\n<ul>\n<li>Permissions&#xff08;\u6743\u9650&#xff09;&#xff1a;\u5728\u6b64\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u901a\u8fc7\u5c06\u53d7\u4fdd\u62a4\u8d44\u6e90\u548c\u4f5c\u7528\u57df\u4e0e\u4f60\u521b\u5efa\u7684\u7b56\u7565\u94fe\u63a5\u8d77\u6765&#xff0c;\u7ba1\u7406\u5b83\u4eec\u7684\u6743\u9650\u3002<\/li>\n<\/ul>\n<p>\u6743\u9650\u5c06\u7b56\u7565\u548c\u8d44\u6e90\u5173\u8054\u8d77\u6765&#xff0c;\u4e00\u822c\u57fa\u4e8e\u8d44\u6e90\u65b0\u5efa\u6743\u9650(\u6743\u9650\u548c\u8d44\u6e90\u3001\u7b56\u7565\u90fd\u662f\u591a\u5bf9\u591a\u7684\u5173\u7cfb)<\/p>\n<ul>\n<li>\n<p>Evaluate&#xff08;\u8bc4\u4f30&#xff09;&#xff1a;\u4ece\u5728\u6b64\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u6a21\u62df\u6388\u6743\u8bf7\u6c42\u5e76\u67e5\u770b\u4f60\u5b9a\u4e49\u7684\u6743\u9650\u548c\u6388\u6743\u7b56\u7565\u7684\u8bc4\u4f30\u7ed3\u679c\u3002<\/p>\n<\/li>\n<li>\n<p>Export Settings&#xff08;\u5bfc\u51fa\u8bbe\u7f6e&#xff09;&#xff1a;\u5728\u6b64\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u5c06\u6388\u6743\u8bbe\u7f6e\u5bfc\u51fa\u5230\u4e00\u4e2a JSON \u6587\u4ef6\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>\u8d44\u6e90\u670d\u52a1\u5668\u8bbe\u7f6e<\/h4>\n<p>\u5728Resource Server Settings &#xff08;\u8d44\u6e90\u670d\u52a1\u5668\u8bbe\u7f6e&#xff09;\u9875\u9762&#xff0c;\u4f60\u53ef\u4ee5\u914d\u7f6e\u7b56\u7565\u6267\u884c\u6a21\u5f0f\u3001\u5141\u8bb8\u8fdc\u7a0b\u8d44\u6e90\u7ba1\u7406\u4ee5\u53ca\u5bfc\u51fa\u6388\u6743\u914d\u7f6e\u8bbe\u7f6e\u3002<\/p>\n<ul>\n<li>\n<p>Policy enforcement mode&#xff08;\u7b56\u7565\u6267\u884c\u6a21\u5f0f&#xff09;&#xff1a;<\/p>\n<p>\u6307\u5b9a\u5728\u5904\u7406\u53d1\u9001\u5230\u670d\u52a1\u5668\u7684\u6388\u6743\u8bf7\u6c42\u65f6\u5982\u4f55\u6267\u884c\u7b56\u7565\u3002<\/p>\n<ul>\n<li>Enforcing&#xff08;\u5f3a\u5236\u6267\u884c&#xff09;&#xff1a;\u9ed8\u8ba4\u6a21\u5f0f&#xff0c;\u5373\u4f7f\u4e0e\u7ed9\u5b9a\u8d44\u6e90\u6ca1\u6709\u5173\u8054\u7684\u7b56\u7565&#xff0c;\u8bf7\u6c42\u4e5f\u4f1a\u88ab\u62d2\u7edd\u3002<\/li>\n<\/ul>\n<p>\u542b\u4e49&#xff1a;\u201c\u5f3a\u5236\u6267\u884c\u201d \u6a21\u5f0f\u610f\u5473\u7740&#xff0c;\u5373\u4f7f\u67d0\u4e2a\u7279\u5b9a\u8d44\u6e90\u6ca1\u6709\u5173\u8054\u4efb\u4f55\u7b56\u7565&#xff0c;\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u5bf9\u8be5\u8d44\u6e90\u7684\u8bbf\u95ee\u8bf7\u6c42\u4e5f\u4f1a\u88ab\u62d2\u7edd\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b&#xff0c;\u7cfb\u7edf\u79c9\u6301 \u201c\u6ca1\u6709\u660e\u786e\u5141\u8bb8\u5c31\u662f\u7981\u6b62\u201d \u7684\u539f\u5219&#xff0c;\u53ea\u6709\u5f53\u8d44\u6e90\u660e\u786e\u5173\u8054\u4e86\u5141\u8bb8\u8bbf\u95ee\u7684\u7b56\u7565\u65f6&#xff0c;\u8bf7\u6c42\u624d\u53ef\u80fd\u88ab\u653e\u884c\u3002 \u5e94\u7528\u573a\u666f&#xff1a;\u9002\u7528\u4e8e\u5bf9\u5b89\u5168\u6027\u8981\u6c42\u6781\u9ad8\u7684\u73af\u5883&#xff0c;\u4f8b\u5982\u91d1\u878d\u4ea4\u6613\u7cfb\u7edf\u3001\u519b\u4e8b\u6307\u6325\u7cfb\u7edf\u7b49\u3002\u5728\u8fd9\u4e9b\u573a\u666f\u4e2d&#xff0c;\u4efb\u4f55\u672a\u7ecf\u6388\u6743\u7684\u8bbf\u95ee\u90fd\u53ef\u80fd\u5e26\u6765\u4e25\u91cd\u7684\u540e\u679c&#xff0c;\u56e0\u6b64\u9700\u8981\u4e25\u683c\u63a7\u5236\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650&#xff0c;\u5373\u4f7f\u6ca1\u6709\u989d\u5916\u7684\u7b56\u7565\u7ea6\u675f&#xff0c;\u4e5f\u4e0d\u5141\u8bb8\u968f\u610f\u8bbf\u95ee\u3002<\/p>\n<ul>\n<li>Permissive&#xff08;\u5141\u8bb8&#xff09;&#xff1a;\u5373\u4f7f\u4e0e\u7ed9\u5b9a\u8d44\u6e90\u6ca1\u6709\u5173\u8054\u7684\u7b56\u7565&#xff0c;\u8bf7\u6c42\u4e5f\u4f1a\u88ab\u5141\u8bb8\u3002<\/li>\n<\/ul>\n<p>\u542b\u4e49&#xff1a;\u201c\u5bbd\u677e\u201d \u6a21\u5f0f\u8868\u793a&#xff0c;\u5373\u4fbf\u67d0\u4e2a\u8d44\u6e90\u6ca1\u6709\u5173\u8054\u4efb\u4f55\u7b56\u7565&#xff0c;\u5bf9\u8be5\u8d44\u6e90\u7684\u8bbf\u95ee\u8bf7\u6c42\u4e5f\u4f1a\u88ab\u5141\u8bb8\u3002\u6b64\u6a21\u5f0f\u9075\u5faa \u201c\u6ca1\u6709\u660e\u786e\u7981\u6b62\u5c31\u662f\u5141\u8bb8\u201d \u7684\u7406\u5ff5&#xff0c;\u7ed9\u4e88\u4e86\u66f4\u591a\u7684\u8bbf\u95ee\u81ea\u7531\u5ea6\u3002 \u5e94\u7528\u573a\u666f&#xff1a;\u5e38\u7528\u4e8e\u5f00\u53d1\u3001\u6d4b\u8bd5\u73af\u5883\u6216\u8005\u5bf9\u8d44\u6e90\u8bbf\u95ee\u9650\u5236\u8981\u6c42\u76f8\u5bf9\u8f83\u4f4e\u7684\u573a\u666f\u3002\u4f8b\u5982&#xff0c;\u5728\u8f6f\u4ef6\u5f00\u53d1\u7684\u6d4b\u8bd5\u9636\u6bb5&#xff0c;\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u4eba\u5458\u5feb\u901f\u9a8c\u8bc1\u529f\u80fd&#xff0c;\u5bf9\u4e8e\u4e00\u4e9b\u4e34\u65f6\u521b\u5efa\u7684\u8d44\u6e90&#xff0c;\u53ef\u4ee5\u91c7\u7528\u5bbd\u677e\u6a21\u5f0f&#xff0c;\u907f\u514d\u9891\u7e41\u914d\u7f6e\u7b56\u7565\u7684\u7e41\u7410\u8fc7\u7a0b&#xff0c;\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<ul>\n<li>Disabled&#xff08;\u7981\u7528&#xff09;&#xff1a;\u7981\u7528\u6240\u6709\u7b56\u7565\u7684\u8bc4\u4f30&#xff0c;\u5e76\u5141\u8bb8\u8bbf\u95ee\u6240\u6709\u8d44\u6e90\u3002<\/li>\n<\/ul>\n<p>\u542b\u4e49&#xff1a;\u201c\u7981\u7528\u201d \u6a21\u5f0f\u4f1a\u5b8c\u5168\u7981\u7528\u7b56\u7565\u8bc4\u4f30\u8fc7\u7a0b&#xff0c;\u5141\u8bb8\u5bf9\u4efb\u4f55\u8d44\u6e90\u8fdb\u884c\u8bbf\u95ee\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b&#xff0c;\u7cfb\u7edf\u4e0d\u4f1a\u68c0\u67e5\u4efb\u4f55\u4e0e\u8d44\u6e90\u76f8\u5173\u7684\u7b56\u7565&#xff0c;\u76f4\u63a5\u653e\u884c\u6240\u6709\u8bbf\u95ee\u8bf7\u6c42\u3002 \u5e94\u7528\u573a\u666f&#xff1a;\u901a\u5e38\u5728\u7279\u6b8a\u60c5\u51b5\u4e0b\u4f7f\u7528&#xff0c;\u6bd4\u5982\u7cfb\u7edf\u8fdb\u884c\u7d27\u6025\u7ef4\u62a4\u3001\u6545\u969c\u6392\u67e5\u65f6&#xff0c;\u9700\u8981\u5feb\u901f\u6062\u590d\u5bf9\u6240\u6709\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650&#xff0c;\u4ee5\u4fbf\u8fdb\u884c\u5168\u9762\u7684\u68c0\u67e5\u548c\u4fee\u590d\u3002\u4f46\u8fd9\u79cd\u6a21\u5f0f\u5b58\u5728\u8f83\u5927\u7684\u5b89\u5168\u98ce\u9669&#xff0c;\u4f7f\u7528\u540e\u5e94\u53ca\u65f6\u6062\u590d\u5230\u6b63\u5e38\u7684\u7b56\u7565\u6267\u884c\u6a21\u5f0f<\/p>\n<\/li>\n<li>\n<p>Decision strategy&#xff08;\u51b3\u7b56\u7b56\u7565&#xff09;&#xff1a;\u6b64\u914d\u7f6e\u4f1a\u66f4\u6539\u7b56\u7565\u8bc4\u4f30\u5f15\u64ce\u6839\u636e\u6240\u6709\u8bc4\u4f30\u6743\u9650\u7684\u7ed3\u679c\u51b3\u5b9a\u662f\u5426\u6388\u4e88\u5bf9\u8d44\u6e90\u6216\u4f5c\u7528\u57df\u7684\u8bbf\u95ee\u6743\u9650\u7684\u65b9\u5f0f\u3002<\/p>\n<ul>\n<li>\n<p>\u201cAffirmative\u201d&#xff08;\u80af\u5b9a&#xff09;\u610f\u5473\u7740\u81f3\u5c11\u6709\u4e00\u4e2a\u6743\u9650\u5fc5\u987b\u8bc4\u4f30\u4e3a\u80af\u5b9a\u51b3\u7b56&#xff0c;\u624d\u80fd\u6388\u4e88\u5bf9\u8d44\u6e90\u53ca\u5176\u4f5c\u7528\u57df\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<\/li>\n<li>\n<p>\u201cUnanimous\u201d&#xff08;\u4e00\u81f4\u540c\u610f&#xff09;\u610f\u5473\u7740\u6240\u6709\u6743\u9650\u5fc5\u987b\u8bc4\u4f30\u4e3a\u80af\u5b9a\u51b3\u7b56&#xff0c;\u6700\u7ec8\u51b3\u7b56\u624d\u4e3a\u80af\u5b9a\u3002\u4f8b\u5982&#xff0c;\u5982\u679c\u5bf9\u540c\u4e00\u8d44\u6e90\u6216\u4f5c\u7528\u57df\u7684\u4e24\u4e2a\u6743\u9650\u53d1\u751f\u51b2\u7a81&#xff08;\u4e00\u4e2a\u6388\u4e88\u8bbf\u95ee\u6743\u9650&#xff0c;\u53e6\u4e00\u4e2a\u62d2\u7edd\u8bbf\u95ee\u6743\u9650&#xff09;&#xff0c;<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u9009\u62e9\u7684\u7b56\u7565\u662f \u201cAffirmative\u201d&#xff0c;\u5219\u5c06\u6388\u4e88\u5bf9\u8be5\u8d44\u6e90\u6216\u4f5c\u7528\u57df\u7684\u6743\u9650\u3002\u5426\u5219&#xff0c;\u4efb\u4f55\u4e00\u4e2a\u6743\u9650\u7684\u62d2\u7edd\u90fd\u5c06\u62d2\u7edd\u8bbf\u95ee\u8be5\u8d44\u6e90\u6216\u4f5c\u7528\u57df\u3002<\/p>\n<\/li>\n<\/ul>\n<p>Keycloak\u5728\u8bc4\u4f30-\u4e00\u4e2a\u6743\u9650\u65f6\u4f1a\u8bc4\u4f30\u6240\u6709\u5173\u8054\u7b56\u7565&#xff0c;\u6bcf\u6761\u7b56\u7565\u4f1a\u8fd4\u56de\u6b63\u6216\u8d1f\u7684\u7ed3\u679c\u3002<\/p>\n<ul>\n<li>DecisionStrategy\u51b3\u5b9a\u4e86\u7b56\u7565\u7684\u8bc4\u4f30\u7ed3\u679c\u5982\u4f55\u51b3\u5b9a\u6743\u9650\u7684\u8bc4\u4f30\u7ed3\u679c<\/li>\n<li>Unanimous&#xff1a;\u4e00\u81f4&#xff0c;\u6240\u6709\u7684\u7b56\u7565\u90fd\u8bc4\u4f30\u4e3a\u6b63\u662f\u6743\u9650\u8bc4\u4f30\u4e3a\u6b63&#xff0c;\u5426\u5219\u4e3a\u8d1f\u3002<\/li>\n<li>Affirmative&#xff1a;\u80af\u5b9a&#xff0c;\u81f3\u5c11\u6709\u4e00\u4e2a\u7b56\u7565\u8bc4\u4f30\u4e3a\u6b63\u5219\u6743\u9650\u8bc4\u4f30\u4e3a\u6b63&#xff0c;\u5426\u5219\u4e3a\u8d1f\u3002Affirmative\u662f\u5e38\u7528\u7684\u7b56\u7565\u3002<\/li>\n<li>Consensus&#xff1a;\u5171\u8bc6&#xff0c;\u5f53\u8bc4\u4f30\u4e3a\u6b63\u7684\u7b56\u7565\u6570\u5927\u4e8e\u8bc4\u4f30\u4e3a\u8d1f\u7684\u7b56\u7565\u6570\u65f6&#xff0c;\u6743\u9650\u8bc4\u4f30\u4e3a\u6b63&#xff0c;\u5426\u5219\u4e3a\u8d1f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8fdc\u7a0b\u8d44\u6e90\u7ba1\u7406&#xff1a;\u6307\u5b9a\u8d44\u6e90\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8fdc\u7a0b\u7ba1\u7406\u8d44\u6e90\u3002\u5982\u679c\u4e3a \u201cfalse\u201d&#xff0c;\u5219\u53ea\u80fd\u4ece\u7ba1\u7406\u63a7\u5236\u53f0\u7ba1\u7406\u8d44\u6e90\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>\u9ed8\u8ba4\u914d\u7f6e<\/h3>\n<p>\u5f53\u4f60\u521b\u5efa\u4e00\u4e2a\u8d44\u6e90\u670d\u52a1\u5668\u65f6&#xff0c;Keycloak \u4f1a\u4e3a\u65b0\u521b\u5efa\u7684\u8d44\u6e90\u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a\u9ed8\u8ba4\u914d\u7f6e\u3002\u9ed8\u8ba4\u914d\u7f6e\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e00\u4e2a\u9ed8\u8ba4\u53d7\u4fdd\u62a4\u8d44\u6e90&#xff0c;\u4ee3\u8868\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u6240\u6709\u8d44\u6e90\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e00\u4e2a\u59cb\u7ec8\u6388\u4e88\u5bf9\u53d7\u6b64\u7b56\u7565\u4fdd\u62a4\u7684\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650\u7684\u7b56\u7565\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e00\u4e2a\u57fa\u4e8e\u9ed8\u8ba4\u7b56\u7565\u7ba1\u7406\u5bf9\u6240\u6709\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650\u7684\u6743\u9650\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>\u9ed8\u8ba4\u53d7\u4fdd\u62a4\u8d44\u6e90<\/h4>\n<p>\u9ed8\u8ba4\u53d7\u4fdd\u62a4\u8d44\u6e90\u79f0\u4e3a\u9ed8\u8ba4\u8d44\u6e90&#xff0c;\u4f60\u53ef\u4ee5\u5bfc\u822a\u5230 \u201cResources\u201d&#xff08;\u8d44\u6e90&#xff09;\u9009\u9879\u5361\u67e5\u770b\u5b83\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150730-68026ab272f20.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u6b64\u8d44\u6e90\u5b9a\u4e49\u4e86\u4e00\u4e2a Type\u4e3a\u201curn:my-resource-server:resources:default\u201d\u3001URI\u4e3a\u201c\/*\u201d\u3002\u8fd9\u91cc&#xff0c;\u201cURI\u201d \u5b57\u6bb5\u5b9a\u4e49\u4e86\u4e00\u4e2a\u901a\u914d\u7b26\u6a21\u5f0f&#xff0c;\u5411 Keycloak \u8868\u660e\u6b64\u8d44\u6e90\u4ee3\u8868\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u6240\u6709\u8def\u5f84\u3002\u6362\u53e5\u8bdd\u8bf4&#xff0c;\u4e3a\u5e94\u7528\u7a0b\u5e8f\u542f\u7528\u7b56\u7565\u6267\u884c\u65f6&#xff0c;\u5728\u6388\u4e88\u8bbf\u95ee\u6743\u9650\u4e4b\u524d&#xff0c;\u5c06\u68c0\u67e5\u4e0e\u8be5\u8d44\u6e90\u5173\u8054\u7684\u6240\u6709\u6743\u9650\u3002<\/p>\n<p>\u4e4b\u524d\u63d0\u5230\u7684 \u201cType&#xff08;\u7c7b\u578b&#xff09;\u201d \u5b9a\u4e49\u4e86\u4e00\u4e2a\u503c&#xff0c;\u53ef\u7528\u4e8e\u521b\u5efa\u7c7b\u578b\u5316\u8d44\u6e90\u6743\u9650&#xff0c;\u8fd9\u4e9b\u6743\u9650\u5fc5\u987b\u5e94\u7528\u4e8e\u9ed8\u8ba4\u8d44\u6e90\u6216\u4f7f\u7528\u76f8\u540c\u7c7b\u578b\u521b\u5efa\u7684\u4efb\u4f55\u5176\u4ed6\u8d44\u6e90\u3002<\/p>\n<h4>\u9ed8\u8ba4\u7b56\u7565<\/h4>\n<p>\u9ed8\u8ba4\u7b56\u7565\u79f0\u4e3a \u201conly from realm policy&#xff08;\u4ec5\u6765\u81ea\u9886\u57df\u7b56\u7565&#xff09;\u201d&#xff0c;\u4f60\u53ef\u4ee5\u5bfc\u822a\u5230 \u201cPolicies&#xff08;\u7b56\u7565&#xff09;\u201d \u9009\u9879\u5361\u67e5\u770b\u5b83\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150730-68026ab2ea271.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u6b64\u7b56\u7565\u662f\u4e00\u4e2a\u57fa\u4e8e JavaScript \u7684\u7b56\u7565&#xff0c;\u5b9a\u4e49\u4e86\u4e00\u4e2a\u59cb\u7ec8\u6388\u4e88\u5bf9\u6b64\u7b56\u7565\u4fdd\u62a4\u7684\u8d44\u6e90\u8bbf\u95ee\u6743\u9650\u7684\u6761\u4ef6\u3002\u5982\u679c\u70b9\u51fb\u6b64\u7b56\u7565&#xff0c;\u4f60\u4f1a\u770b\u5230\u5b83\u5b9a\u4e49\u4e86\u5982\u4e0b\u89c4\u5219&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ by default, grants any permission associated with this policy<\/span><br \/>\n<span class=\"token comment\">\/\/ \u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u6388\u4e88\u4e0e\u6b64\u7b56\u7565\u5173\u8054\u7684\u4efb\u4f55\u6743\u9650<\/span><br \/>\n$evaluation<span class=\"token punctuation\">.<\/span><span class=\"token function\">grant<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>\u9ed8\u8ba4\u6743\u9650<\/h4>\n<p>\u6700\u540e&#xff0c;\u9ed8\u8ba4\u6743\u9650\u79f0\u4e3a \u201cdefault permission&#xff08;\u9ed8\u8ba4\u6743\u9650&#xff09;\u201d&#xff0c;\u4f60\u53ef\u4ee5\u5bfc\u822a\u5230 \u201cPermissions&#xff08;\u6743\u9650&#xff09;\u201d \u9009\u9879\u5361\u67e5\u770b\u5b83\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150731-68026ab36c771.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u6b64\u6743\u9650\u662f\u57fa\u4e8e\u8d44\u6e90\u7684\u6743\u9650&#xff0c;\u7528\u4e8e\u5b9a\u4e49\u4e00\u7ec4\u4e00\u4e2a\u6216\u591a\u4e2a\u7b56\u7565&#xff0c;\u8fd9\u4e9b\u7b56\u7565\u5c06\u5e94\u7528\u4e8e\u5177\u6709\u7ed9\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u8d44\u6e90<\/p>\n<h4>\u66f4\u6539\u9ed8\u8ba4\u914d\u7f6e<\/h4>\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u5220\u9664\u9ed8\u8ba4\u8d44\u6e90\u3001\u7b56\u7565\u6216\u6743\u9650\u5b9a\u4e49\u5e76\u521b\u5efa\u81ea\u5df1\u7684\u5b9a\u4e49\u6765\u66f4\u6539\u9ed8\u8ba4\u914d\u7f6e\u3002<\/p>\n<p>\u9ed8\u8ba4\u8d44\u6e90\u662f\u4f7f\u7528 URI \u521b\u5efa\u7684&#xff0c;\u8be5 URI \u4f7f\u7528 \/* \u6a21\u5f0f\u6620\u5c04\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684\u4efb\u4f55\u8d44\u6e90\u6216\u8def\u5f84\u3002\u5728\u521b\u5efa\u81ea\u5df1\u7684\u8d44\u6e90\u3001\u6743\u9650\u548c\u7b56\u7565\u4e4b\u524d&#xff0c;\u8bf7\u521b\u5efa \u786e\u4fdd\u9ed8\u8ba4\u914d\u7f6e\u4e0d\u4f1a\u4e0e\u60a8\u81ea\u5df1\u7684\u8bbe\u7f6e\u51b2\u7a81\u3002<\/p>\n<p>&#x1f4a1;\u9ed8\u8ba4\u914d\u7f6e\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6620\u5c04\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6240\u6709\u8def\u5f84\u7684\u8d44\u6e90\u3002\u5982\u679c\u4f60\u8981\u4e3a\u81ea\u5df1\u7684\u8d44\u6e90\u7f16\u5199\u6743\u9650&#xff0c;\u8bf7\u52a1\u5fc5\u5220\u9664Default Resource \u6216\u5c06\u5176 \u201cURIs\u201d \u5b57\u6bb5\u66f4\u6539\u4e3a\u5e94\u7528\u7a0b\u5e8f\u4e2d\u66f4\u5177\u4f53\u7684\u8def\u5f84\u3002\u5426\u5219&#xff0c;\u4e0e\u9ed8\u8ba4\u8d44\u6e90\u5173\u8054\u7684\u7b56\u7565&#xff08;\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u59cb\u7ec8\u6388\u4e88\u8bbf\u95ee\u6743\u9650&#xff09;\u5c06\u5141\u8bb8 Keycloak \u6388\u4e88\u5bf9\u4efb\u4f55\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<h3>\u5bfc\u51fa\u548c\u5bfc\u5165\u6388\u6743\u914d\u7f6e<\/h3>\n<p>\u8d44\u6e90\u670d\u52a1\u5668&#xff08;\u6216\u5ba2\u6237\u7aef&#xff09;\u7684\u914d\u7f6e\u8bbe\u7f6e\u53ef\u4ee5\u5bfc\u51fa\u5e76\u4e0b\u8f7d\u3002\u4f60\u8fd8\u53ef\u4ee5\u5bfc\u5165\u73b0\u6709\u8d44\u6e90\u670d\u52a1\u5668\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5bfc\u5165\u548c\u5bfc\u51fa\u914d\u7f6e\u6587\u4ef6\u5728\u4f60\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u521b\u5efa\u521d\u59cb\u914d\u7f6e\u6216\u66f4\u65b0\u73b0\u6709\u914d\u7f6e\u65f6\u5f88\u6709\u7528\u3002\u914d\u7f6e\u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u5b9a\u4e49&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u53d7\u4fdd\u62a4\u8d44\u6e90\u548c\u8303\u56f4<\/p>\n<\/li>\n<li>\n<p>\u7b56\u7565<\/p>\n<\/li>\n<li>\n<p>\u6743\u9650<\/p>\n<\/li>\n<\/ul>\n<h4>\u5bfc\u51fa\u914d\u7f6e\u6587\u4ef6<\/h4>\n<li>\n<p>\u70b9\u51fb\u83dc\u5355\u4e2d\u7684 \u201cClients&#xff08;\u5ba2\u6237\u7aef&#xff09;\u201d\u3002<\/p>\n<\/li>\n<li>\n<p>\u70b9\u51fb\u4f60\u521b\u5efa\u7684\u4f5c\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u7684\u5ba2\u6237\u7aef\u3002<\/p>\n<\/li>\n<li>\n<p>\u70b9\u51fb \u201cExport&#xff08;\u5bfc\u51fa&#xff09;\u201d \u9009\u9879\u5361\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150731-68026ab3dbcee.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<p>\u914d\u7f6e\u6587\u4ef6\u5c06\u4ee5 JSON \u683c\u5f0f\u5bfc\u51fa\u5e76\u663e\u793a\u5728\u6587\u672c\u533a\u57df\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u4ece\u4e2d\u590d\u5236\u548c\u7c98\u8d34\u3002\u4f60\u4e5f\u53ef\u4ee5\u70b9\u51fb \u201cDownload&#xff08;\u4e0b\u8f7d&#xff09;\u201d \u4e0b\u8f7d\u914d\u7f6e\u6587\u4ef6\u5e76\u4fdd\u5b58\u3002<\/p>\n<h4>\u5bfc\u5165\u914d\u7f6e\u6587\u4ef6<\/h4>\n<li>\n<p>\u5bfc\u822a\u5230 \u201cResource Server Settings&#xff08;\u8d44\u6e90\u670d\u52a1\u5668\u8bbe\u7f6e&#xff09;\u201d \u9875\u9762\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150732-68026ab48a7f2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u70b9\u51fb \u201cImport&#xff08;\u5bfc\u5165&#xff09;\u201d \u5e76\u9009\u62e9\u5305\u542b\u8981\u5bfc\u5165\u914d\u7f6e\u7684\u6587\u4ef6\u3002<\/p>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u6839\u636e OAuth2 \u89c4\u8303\uff0c\u8d44\u6e90\u670d\u52a1\u5668\u662f\u6258\u7ba1\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u670d\u52a1\u5668\uff0c\u80fd\u591f\u63a5\u53d7\u5e76\u54cd\u5e94\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u8bf7\u6c42\u3002\u5728 Keycloak \u4e2d\uff0c\u8d44\u6e90\u670d\u52a1\u5668\u4e3a\u5176\u53d7\u4fdd\u62a4\u8d44\u6e90\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e30\u5bcc\u7684\u5e73\u53f0\uff0c\u7528\u4e8e\u5b9e\u73b0\u7ec6\u7c92\u5ea6\u6388\u6743\uff0c\u6388\u6743\u51b3\u7b56\u53ef\u4ee5\u57fa\u4e8e\u4e0d\u540c\u7684\u8bbf\u95ee\u63a7\u5236\u673a\u5236\u505a\u51fa\u3002\u4efb\u4f55\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u90fd\u53ef\u4ee5\u914d\u7f6e\u4e3a\u652f\u6301\u7ec6\u7c92\u5ea6\u6743\u9650\u3002\u8fd9\u6837\u505a\u65f6\uff0c\u4ece\u6982\u5ff5\u4e0a\u8bb2\uff0c\u4f60\u6b63\u5728\u5c06\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u8f6c\u53d8\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u3002_decisionstrategy unanimous<\/p>\n","protected":false},"author":2,"featured_media":16672,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1182,1183,99,43,478,44,250],"topic":[],"class_list":["post-16682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-keycloak-","tag-authing","tag-java","tag-43","tag-478","tag-44","tag-250"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/16682.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u6839\u636e OAuth2 \u89c4\u8303\uff0c\u8d44\u6e90\u670d\u52a1\u5668\u662f\u6258\u7ba1\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u670d\u52a1\u5668\uff0c\u80fd\u591f\u63a5\u53d7\u5e76\u54cd\u5e94\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u8bf7\u6c42\u3002\u5728 Keycloak \u4e2d\uff0c\u8d44\u6e90\u670d\u52a1\u5668\u4e3a\u5176\u53d7\u4fdd\u62a4\u8d44\u6e90\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e30\u5bcc\u7684\u5e73\u53f0\uff0c\u7528\u4e8e\u5b9e\u73b0\u7ec6\u7c92\u5ea6\u6388\u6743\uff0c\u6388\u6743\u51b3\u7b56\u53ef\u4ee5\u57fa\u4e8e\u4e0d\u540c\u7684\u8bbf\u95ee\u63a7\u5236\u673a\u5236\u505a\u51fa\u3002\u4efb\u4f55\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u90fd\u53ef\u4ee5\u914d\u7f6e\u4e3a\u652f\u6301\u7ec6\u7c92\u5ea6\u6743\u9650\u3002\u8fd9\u6837\u505a\u65f6\uff0c\u4ece\u6982\u5ff5\u4e0a\u8bb2\uff0c\u4f60\u6b63\u5728\u5c06\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u8f6c\u53d8\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u3002_decisionstrategy unanimous\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/16682.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T15:07:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150727-68026aafbc4b2.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/16682.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/16682.html\",\"name\":\"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T15:07:34+00:00\",\"dateModified\":\"2025-04-18T15:07:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/16682.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/16682.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/16682.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/16682.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u6839\u636e OAuth2 \u89c4\u8303\uff0c\u8d44\u6e90\u670d\u52a1\u5668\u662f\u6258\u7ba1\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u670d\u52a1\u5668\uff0c\u80fd\u591f\u63a5\u53d7\u5e76\u54cd\u5e94\u53d7\u4fdd\u62a4\u8d44\u6e90\u7684\u8bf7\u6c42\u3002\u5728 Keycloak \u4e2d\uff0c\u8d44\u6e90\u670d\u52a1\u5668\u4e3a\u5176\u53d7\u4fdd\u62a4\u8d44\u6e90\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e30\u5bcc\u7684\u5e73\u53f0\uff0c\u7528\u4e8e\u5b9e\u73b0\u7ec6\u7c92\u5ea6\u6388\u6743\uff0c\u6388\u6743\u51b3\u7b56\u53ef\u4ee5\u57fa\u4e8e\u4e0d\u540c\u7684\u8bbf\u95ee\u63a7\u5236\u673a\u5236\u505a\u51fa\u3002\u4efb\u4f55\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u90fd\u53ef\u4ee5\u914d\u7f6e\u4e3a\u652f\u6301\u7ec6\u7c92\u5ea6\u6743\u9650\u3002\u8fd9\u6837\u505a\u65f6\uff0c\u4ece\u6982\u5ff5\u4e0a\u8bb2\uff0c\u4f60\u6b63\u5728\u5c06\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u8f6c\u53d8\u4e3a\u8d44\u6e90\u670d\u52a1\u5668\u3002_decisionstrategy unanimous","og_url":"https:\/\/www.wsisp.com\/helps\/16682.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T15:07:34+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418150727-68026aafbc4b2.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/16682.html","url":"https:\/\/www.wsisp.com\/helps\/16682.html","name":"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T15:07:34+00:00","dateModified":"2025-04-18T15:07:34+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/16682.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/16682.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/16682.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7b2c2_3\u7ae0_\u5165\u95e8&amp;\u7ba1\u7406\u8d44\u6e90\u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/16682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=16682"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/16682\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/16672"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=16682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=16682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=16682"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=16682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}