{"id":21410,"date":"2025-04-19T04:36:51","date_gmt":"2025-04-18T20:36:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/21410.html"},"modified":"2025-04-19T04:36:51","modified_gmt":"2025-04-18T20:36:51","slug":"oauth2%e6%8e%88%e6%9d%83web%e5%89%8d%e7%ab%afnodecoze-api-web%e5%90%8e%e7%ab%af%e7%a8%8b%e5%ba%8fcoze%e6%8e%88%e6%9d%83%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%b7%a5%e4%bd%9c%e6%b5%81%e7%a8%8b%e8%af%a6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/21410.html","title":{"rendered":"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3"},"content":{"rendered":"<p>oAuth2\u6388\u6743 oAuth\u6388\u6743\u7801\u6388\u6743_CozeAPI\u5b98\u65b9\u6587\u6863<\/p>\n<p>\u7528\u6237\u7684\u95ee\u9898\u662f\u5173\u4e8e\u4f7f\u7528CozeAPI\u548cNode.js\u6784\u5efa\u4e00\u4e2aWeb\u540e\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u901a\u8fc7\u524d\u7aef\u8c03\u7528\uff0c\u5229\u7528OAuth2\u8fdb\u884c\u6388\u6743\u3002\u9700\u8981\u7ed9\u51fa\u5927\u81f4\u7684\u601d\u8def\u548c\u4ee3\u7801\u793a\u4f8b\uff0c\u7528\u5bb9\u6613\u7406\u89e3\u7684\u65b9\u5f0f\u8868\u8fbe\u3002\u9996\u5148\uff0c\u6211\u9700\u8981\u7406\u6e05OAuth2\u7684\u6388\u6743\u6d41\u7a0b\uff0c\u5c24\u5176\u662f\u6388\u6743\u7801\u6a21\u5f0f\uff0c\u56e0\u4e3a\u8fd9\u662f\u6700\u5e38\u89c1\u4e14\u5b89\u5168\u7684\u65b9\u5f0f\uff0c\u9002\u7528\u4e8eWeb\u5e94\u7528\u3002<\/p>\n<p>\u6bd4\u5982\uff0c\u90fd\u63d0\u5230\u6388\u6743\u7801\u6d41\u7a0b\uff08Authorization Code Grant\uff09\u662f\u9002\u7528\u4e8e\u670d\u52a1\u7aef\u5e94\u7528\u7684\uff0c\u7528\u6237\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230\u6388\u6743\u670d\u52a1\u5668\uff0c\u83b7\u53d6\u6388\u6743\u7801\uff0c\u7136\u540e\u7528\u6388\u6743\u7801\u6362\u53d6\u8bbf\u95ee\u4ee4\u724c\u3002\u8fd9\u4e2a\u6d41\u7a0b\u9700\u8981\u524d\u540e\u7aef\u534f\u4f5c\uff0c\u524d\u7aef\u8d1f\u8d23\u8df3\u8f6c\u548c\u83b7\u53d6code\uff0c\u540e\u7aef\u7528code\u6362token\uff0c\u5e76\u5b58\u50a8token\u4ee5\u4f9b\u540e\u7eedAPI\u8c03\u7528\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u9700\u8981\u8003\u8651\u5982\u4f55\u7ec4\u7ec7\u4ee3\u7801\u7ed3\u6784\u3002\u63d0\u5230\u4f7f\u7528Node.js\u548cOAuth2orize\u5e93\u6765\u5b9e\u73b0OAuth2\u670d\u52a1\u5668\uff0c\u8fd9\u53ef\u80fd\u5bf9\u540e\u7aef\u6709\u5e2e\u52a9\u3002\u6b64\u5916\uff0c\u4e2d\u7684\u524d\u540e\u7aef\u5206\u79bb\u4f8b\u5b50\uff0c\u524d\u7aef\u83b7\u53d6code\u540e\u4f20\u7ed9\u540e\u7aef\u5904\u7406\uff0c\u8fd9\u4e5f\u7b26\u5408\u7528\u6237\u7684\u9700\u6c42\u3002<\/p>\n<p>\u9996\u5148\uff0c\u786e\u5b9a\u6388\u6743\u6d41\u7a0b\u6b65\u9aa4\uff1a<\/p>\n<li>\u524d\u7aef\u5411\u540e\u7aef\u53d1\u8d77\u767b\u5f55\u8bf7\u6c42\u3002<\/li>\n<li>\u540e\u7aef\u751f\u6210\u6388\u6743URL\uff0c\u8fd4\u56de\u7ed9\u524d\u7aef\u3002<\/li>\n<li>\u524d\u7aef\u91cd\u5b9a\u5411\u7528\u6237\u5230\u6388\u6743\u670d\u52a1\u5668\u3002<\/li>\n<li>\u7528\u6237\u540c\u610f\u6388\u6743\u540e\uff0c\u6388\u6743\u670d\u52a1\u5668\u91cd\u5b9a\u5411\u56de\u524d\u7aef\u7684\u56de\u8c03URL\uff0c\u5e76\u9644\u5e26code\u3002<\/li>\n<li>\u524d\u7aef\u5c06code\u4f20\u7ed9\u540e\u7aef\uff0c\u540e\u7aef\u7528code\u5411\u6388\u6743\u670d\u52a1\u5668\u8bf7\u6c42token\u3002<\/li>\n<li>\u540e\u7aef\u5b58\u50a8token\uff0c\u8fd4\u56desession\u6216JWT\u7ed9\u524d\u7aef\uff0c\u7528\u4e8e\u540e\u7eed\u8ba4\u8bc1\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203650-6802b7e2744d9.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"><\/li>\n<p>\u4ee3\u7801\u65b9\u9762\uff0c\u540e\u7aef\u9700\u8981\u5904\u7406\u751f\u6210\u6388\u6743URL\u3001\u5904\u7406\u56de\u8c03\u3001\u7528code\u6362token\u7684\u903b\u8f91\u3002\u524d\u7aef\u9700\u8981\u5904\u7406\u91cd\u5b9a\u5411\u548c\u4f20\u9012code\u3002\u4f8b\u5982\uff0c\u5728Node.js\u4e2d\u4f7f\u7528Express\u6846\u67b6\uff0c\u8bbe\u7f6e\u8def\u7531\u5904\u7406\u8fd9\u4e9b\u6b65\u9aa4\u3002<\/p>\n<p>\u6388\u6743\u670d\u52a1\u5668\u7684\u914d\u7f6e\u4e5f\u5f88\u91cd\u8981\uff0c\u6bd4\u5982client_id\u3001client_secret\u3001redirect_uri\u7b49\u53c2\u6570\u9700\u8981\u6b63\u786e\u8bbe\u7f6e\uff0c\u8fd9\u4e9b\u5728\u548c\u4e2d\u6709\u63d0\u5230\u3002\u6b64\u5916\uff0c\u5b89\u5168\u6027\u65b9\u9762\uff0c\u5982state\u53c2\u6570\u9632CSRF\uff0c\u5728\u4e2d\u88ab\u5f3a\u8c03\uff0c\u9700\u8981\u5728\u5b9e\u73b0\u65f6\u6ce8\u610f\u3002<\/p>\n<p>\u5728\u4ee3\u7801\u793a\u4f8b\u90e8\u5206\uff0c\u53ef\u4ee5\u5206\u540e\u7aef\u548c\u524d\u7aef\u90e8\u5206\u3002\u540e\u7aef\u7528Express\u521b\u5efa\u8def\u7531\uff0c\u5904\u7406\u6388\u6743\u8bf7\u6c42\u548c\u56de\u8c03\uff0c\u4f7f\u7528axios\u7b49\u5e93\u5411\u6388\u6743\u670d\u52a1\u5668\u8bf7\u6c42token\u3002\u524d\u7aef\u7528JavaScript\u5904\u7406\u8df3\u8f6c\u548c\u4f20\u9012code\u3002\u4f8b\u5982\uff0c\u5f53\u7528\u6237\u70b9\u51fb\u767b\u5f55\u6309\u94ae\u65f6\uff0c\u524d\u7aef\u8c03\u7528\u540e\u7aef\u63a5\u53e3\u83b7\u53d6\u6388\u6743URL\uff0c\u7136\u540e\u8df3\u8f6c\uff1b\u6388\u6743\u5b8c\u6210\u540e\uff0c\u4eceURL\u53c2\u6570\u4e2d\u63d0\u53d6code\uff0c\u518d\u53d1\u9001\u7ed9\u540e\u7aef\u6362\u53d6token\u3002<\/p>\n<p>\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u5305\u62ec\u8de8\u57df\u5904\u7406\u3001token\u5b58\u50a8\u5b89\u5168\u3001\u5237\u65b0\u4ee4\u724c\u7684\u5904\u7406\u7b49\u3002\u6839\u636e\uff0c\u4f7f\u7528Passport\u548cOAuth2orize\u53ef\u4ee5\u5e2e\u52a9\u7ba1\u7406\u8fd9\u4e9b\u6d41\u7a0b\u3002\u540c\u65f6\uff0c\u524d\u540e\u7aef\u5206\u79bb\u7684\u60c5\u51b5\u4e0b\uff0c\u786e\u4fdd\u56de\u8c03URL\u6b63\u786e\u914d\u7f6e\uff0c\u907f\u514d\u5b89\u5168\u6f0f\u6d1e\u3002<\/p>\n<p>\u603b\u7ed3\u4e0b\u6765\uff0c\u601d\u8def\u662f\u660e\u786e\u6388\u6743\u7801\u6d41\u7a0b\uff0c\u5206\u6b65\u9aa4\u5b9e\u73b0\u524d\u540e\u7aef\u7684\u4ea4\u4e92\uff0c\u786e\u4fdd\u5404\u53c2\u6570\u6b63\u786e\u4f20\u9012\uff0c\u5e76\u5904\u7406token\u7684\u5b58\u50a8\u548c\u4f7f\u7528\u3002\u4ee3\u7801\u793a\u4f8b\u5e94\u5c55\u793a\u5173\u952e\u6b65\u9aa4\uff0c\u5982\u751f\u6210\u6388\u6743URL\u3001\u5904\u7406\u56de\u8c03\u3001\u4ea4\u6362token\uff0c\u4ee5\u53ca\u8c03\u7528\u53d7\u4fdd\u62a4API\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u57fa\u4e8eOAuth2\u6388\u6743\u7801\u6a21\u5f0f\uff0c\u7ed3\u5408Node.js\u540e\u7aef\u548c\u524d\u7aef\u8c03\u7528\uff0c\u4ee5\u4e0b\u662f\u5b9e\u73b0\u601d\u8def\u53ca\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n<hr>\n<h4>\u5b9e\u73b0\u601d\u8def<\/h4>\n<li>\n<p>\u6d41\u7a0b\u6982\u8ff0<\/p>\n<ul>\n<li>\u4f7f\u7528\u6388\u6743\u7801\u6a21\u5f0f\uff08\u6700\u5b89\u5168\u9002\u5408Web\u5e94\u7528\uff09<\/li>\n<li>\u524d\u7aef\u5f15\u5bfc\u7528\u6237\u8df3\u8f6c\u81f3\u6388\u6743\u670d\u52a1\u5668 \u2192 \u7528\u6237\u6388\u6743\u540e\u8fd4\u56decode \u2192 \u540e\u7aef\u7528code\u6362\u53d6token \u2192 \u5b58\u50a8token\u4f9bAPI\u8c03\u7528<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u6b65\u9aa4<\/p>\n<li>\u524d\u7aef\u89e6\u53d1\u767b\u5f55\uff1a\u70b9\u51fb\u6309\u94ae\u8c03\u7528\u540e\u7aef\u63a5\u53e3\u83b7\u53d6\u6388\u6743URL<\/li>\n<li>\u540e\u7aef\u751f\u6210\u6388\u6743URL\uff1a\u62fc\u63a5\u6388\u6743\u670d\u52a1\u5668\u5730\u5740\u3001client_id\u3001redirect_uri\u7b49\u53c2\u6570<\/li>\n<li>\u7528\u6237\u6388\u6743\uff1a\u524d\u7aef\u8df3\u8f6c\u81f3\u6388\u6743URL\uff0c\u7528\u6237\u767b\u5f55\u5e76\u6388\u6743<\/li>\n<li>\u83b7\u53d6\u6388\u6743\u7801\uff1a\u6388\u6743\u670d\u52a1\u5668\u56de\u8c03\u524d\u7aef\uff0cURL\u4e2d\u643a\u5e26code\u53c2\u6570<\/li>\n<li>\u7528code\u6362token\uff1a\u524d\u7aef\u5c06code\u4f20\u7ed9\u540e\u7aef\uff0c\u540e\u7aef\u5411\u6388\u6743\u670d\u52a1\u5668\u8bf7\u6c42token<\/li>\n<li>\u8c03\u7528API\uff1a\u540e\u7aef\u7528token\u8bbf\u95ee\u53d7\u4fdd\u62a4\u8d44\u6e90\uff0c\u8fd4\u56de\u6570\u636e\u7ed9\u524d\u7aef<\/li>\n<\/li>\n<hr>\n<h4>\u4ee3\u7801\u793a\u4f8b<\/h4>\n<h5>1. \u540e\u7aef\uff08Node.js + Express\uff09<\/h5>\n<p><span class=\"token keyword\">const<\/span> express <span class=\"token operator\">=<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8217;express\\&#8217;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> axios <span class=\"token operator\">=<\/span> <span class=\"token function\">require<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8217;axios\\&#8217;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> app <span class=\"token operator\">=<\/span> <span class=\"token function\">express<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u914d\u7f6eOAuth2\u53c2\u6570<\/span><br \/>\n<span class=\"token keyword\">const<\/span> oauthConfig <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n  <span class=\"token literal-property property\">client_id<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">\\&#8217;YOUR_CLIENT_ID\\&#8217;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token literal-property property\">client_secret<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">\\&#8217;YOUR_CLIENT_SECRET\\&#8217;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token literal-property property\">redirect_uri<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">\\&#8217;http:\/\/localhost:3000\/callback\\&#8217;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token literal-property property\">auth_url<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">\\&#8217;https:\/\/auth-server.com\/authorize\\&#8217;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token literal-property property\">token_url<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">\\&#8217;https:\/\/auth-server.com\/token\\&#8217;<\/span><span class=\"token punctuation\">,<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u63d0\u5230\u6388\u6743\u7801\u6d41\u7a0b\uff08Authorization Code Grant\uff09\u662f\u9002\u7528\u4e8e\u670d\u52a1\u7aef\u5e94\u7528\u7684\uff0c\u7528\u6237\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230\u6388\u6743\u670d\u52a1\u5668\uff0c\u83b7\u53d6\u6388\u6743\u7801\uff0c\u7136\u540e\u7528\u6388\u6743\u7801\u6362\u53d6\u8bbf\u95ee\u4ee4\u724c\u3002\u8fd9\u4e2a\u6d41\u7a0b\u9700\u8981\u524d\u540e\u7aef\u534f\u4f5c\uff0c\u524d\u7aef\u8d1f\u8d23\u8df3\u8f6c\u548c\u83b7\u53d6code\uff0c\u540e\u7aef\u7528code\u6362token\uff0c\u5e76\u5b58\u50a8token\u4ee5\u4f9b\u540e\u7eedAPI\u8c03\u7528\u3002\u9996\u5148\uff0c\u6211\u9700\u8981\u7406\u6e05OAuth2\u7684\u6388\u6743\u6d41\u7a0b\uff0c\u5c24\u5176\u662f\u6388\u6743\u7801\u6a21\u5f0f\uff0c\u56e0\u4e3a\u8fd9\u662f\u6700\u5e38\u89c1\u4e14\u5b89\u5168\u7684\u65b9\u5f0f\uff0c\u9002\u7528\u4e8eWeb\u5e94\u7528\u3002\u603b\u7ed3\u4e0b\u6765\uff0c\u601d\u8def\u662f\u660e\u786e\u6388\u6743\u7801\u6d41\u7a0b\uff0c\u5206\u6b65\u9aa4\u5b9e\u73b0\u524d\u540e\u7aef\u7684\u4ea4\u4e92\uff0c\u786e\u4fdd\u5404\u53c2\u6570\u6b63\u786e\u4f20\u9012\uff0c\u5e76\u5904\u7406token\u7684\u5b58\u50a8\u548c\u4f7f\u7528\u3002\/\/ \u8df3\u8f6c\u81f3\u6388\u6743\u9875\u9762\u3002_coze\u6388\u6743<\/p>\n","protected":false},"author":2,"featured_media":21409,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[87,43,1654,185],"topic":[],"class_list":["post-21410","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-87","tag-43","tag-1654","tag-185"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3 - \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\/21410.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u63d0\u5230\u6388\u6743\u7801\u6d41\u7a0b\uff08Authorization Code Grant\uff09\u662f\u9002\u7528\u4e8e\u670d\u52a1\u7aef\u5e94\u7528\u7684\uff0c\u7528\u6237\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230\u6388\u6743\u670d\u52a1\u5668\uff0c\u83b7\u53d6\u6388\u6743\u7801\uff0c\u7136\u540e\u7528\u6388\u6743\u7801\u6362\u53d6\u8bbf\u95ee\u4ee4\u724c\u3002\u8fd9\u4e2a\u6d41\u7a0b\u9700\u8981\u524d\u540e\u7aef\u534f\u4f5c\uff0c\u524d\u7aef\u8d1f\u8d23\u8df3\u8f6c\u548c\u83b7\u53d6code\uff0c\u540e\u7aef\u7528code\u6362token\uff0c\u5e76\u5b58\u50a8token\u4ee5\u4f9b\u540e\u7eedAPI\u8c03\u7528\u3002\u9996\u5148\uff0c\u6211\u9700\u8981\u7406\u6e05OAuth2\u7684\u6388\u6743\u6d41\u7a0b\uff0c\u5c24\u5176\u662f\u6388\u6743\u7801\u6a21\u5f0f\uff0c\u56e0\u4e3a\u8fd9\u662f\u6700\u5e38\u89c1\u4e14\u5b89\u5168\u7684\u65b9\u5f0f\uff0c\u9002\u7528\u4e8eWeb\u5e94\u7528\u3002\u603b\u7ed3\u4e0b\u6765\uff0c\u601d\u8def\u662f\u660e\u786e\u6388\u6743\u7801\u6d41\u7a0b\uff0c\u5206\u6b65\u9aa4\u5b9e\u73b0\u524d\u540e\u7aef\u7684\u4ea4\u4e92\uff0c\u786e\u4fdd\u5404\u53c2\u6570\u6b63\u786e\u4f20\u9012\uff0c\u5e76\u5904\u7406token\u7684\u5b58\u50a8\u548c\u4f7f\u7528\u3002\/\/ \u8df3\u8f6c\u81f3\u6388\u6743\u9875\u9762\u3002_coze\u6388\u6743\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/21410.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-18T20:36:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203650-6802b7e2744d9.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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/21410.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/21410.html\",\"name\":\"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T20:36:51+00:00\",\"dateModified\":\"2025-04-18T20:36:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/21410.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/21410.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/21410.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3\"}]},{\"@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":"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3 - \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\/21410.html","og_locale":"zh_CN","og_type":"article","og_title":"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u63d0\u5230\u6388\u6743\u7801\u6d41\u7a0b\uff08Authorization Code Grant\uff09\u662f\u9002\u7528\u4e8e\u670d\u52a1\u7aef\u5e94\u7528\u7684\uff0c\u7528\u6237\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230\u6388\u6743\u670d\u52a1\u5668\uff0c\u83b7\u53d6\u6388\u6743\u7801\uff0c\u7136\u540e\u7528\u6388\u6743\u7801\u6362\u53d6\u8bbf\u95ee\u4ee4\u724c\u3002\u8fd9\u4e2a\u6d41\u7a0b\u9700\u8981\u524d\u540e\u7aef\u534f\u4f5c\uff0c\u524d\u7aef\u8d1f\u8d23\u8df3\u8f6c\u548c\u83b7\u53d6code\uff0c\u540e\u7aef\u7528code\u6362token\uff0c\u5e76\u5b58\u50a8token\u4ee5\u4f9b\u540e\u7eedAPI\u8c03\u7528\u3002\u9996\u5148\uff0c\u6211\u9700\u8981\u7406\u6e05OAuth2\u7684\u6388\u6743\u6d41\u7a0b\uff0c\u5c24\u5176\u662f\u6388\u6743\u7801\u6a21\u5f0f\uff0c\u56e0\u4e3a\u8fd9\u662f\u6700\u5e38\u89c1\u4e14\u5b89\u5168\u7684\u65b9\u5f0f\uff0c\u9002\u7528\u4e8eWeb\u5e94\u7528\u3002\u603b\u7ed3\u4e0b\u6765\uff0c\u601d\u8def\u662f\u660e\u786e\u6388\u6743\u7801\u6d41\u7a0b\uff0c\u5206\u6b65\u9aa4\u5b9e\u73b0\u524d\u540e\u7aef\u7684\u4ea4\u4e92\uff0c\u786e\u4fdd\u5404\u53c2\u6570\u6b63\u786e\u4f20\u9012\uff0c\u5e76\u5904\u7406token\u7684\u5b58\u50a8\u548c\u4f7f\u7528\u3002\/\/ \u8df3\u8f6c\u81f3\u6388\u6743\u9875\u9762\u3002_coze\u6388\u6743","og_url":"https:\/\/www.wsisp.com\/helps\/21410.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T20:36:51+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418203650-6802b7e2744d9.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/21410.html","url":"https:\/\/www.wsisp.com\/helps\/21410.html","name":"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T20:36:51+00:00","dateModified":"2025-04-18T20:36:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/21410.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/21410.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/21410.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"[oAuth2\u6388\u6743]Web\u524d\u7aef+Node&amp;Coze API Web\u540e\u7aef\u7a0b\u5e8f+Coze\u6388\u6743\u670d\u52a1\u5668\u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3"}]},{"@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\/21410","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=21410"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/21410\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/21409"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=21410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=21410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=21410"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=21410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}