{"id":4879,"date":"2020-03-11T13:22:22","date_gmt":"2020-03-11T05:22:22","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=4879"},"modified":"2020-03-11T13:22:22","modified_gmt":"2020-03-11T05:22:22","slug":"a-redirect_uri-can-only-be-used-by-implicit-or-authorization_code-grant-types","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4879","title":{"rendered":"A redirect_uri can only be used by implicit or authorization_code grant types."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6709\u65f6\u5019\u4e0d\u5c11\u4eba\u53cd\u9988\u8bf4\uff0c\u6211\u7f51\u7ad9\u4e0a\u4e3a\u4ec0\u4e48\u7ecf\u5e38\u4f1a\u6709\u4e00\u4e9b\u4e71\u4e03\u516b\u7cdf\u7684\u6587\u7ae0\u3002\u6bd4\u5982\u672c\u6587\uff0c\u770b\u8d77\u6765\u5b8c\u5168\u6742\u4e71\u65e0\u7ae0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e9b\u7f51\u53cb\u7684\u610f\u89c1\u6211\u5b8c\u5168\u7406\u89e3\u3002\u4f46\u662f\uff0c\u6211\u7684\u4e2a\u4eba\u7f51\u7ad9\u66f4\u591a\u7684\u6d41\u91cf\u5176\u5b9e\u662f\u6765\u81ea\u4e8e\u767e\u5ea6\u7684\uff0c\u5f88\u591a\u4eba\u662f\u901a\u8fc7\u95ee\u9898\u641c\u7d22\u5230\u6211\u7684\u4e2a\u4eba\u7f51\u7ad9\u4e0a\u7684\u3002\u56e0\u6b64\uff0c\u4e00\u4e9b\u5728\u7f16\u7801\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u7684\u4e00\u4e9b\u83ab\u540d\u5176\u5999\u7684\u95ee\u9898\u80fd\u5e26\u6765\u66f4\u591a\u7684\u8bbf\u95ee\u7528\u6237\uff0c\u4e3a\u4e86\u6d41\u91cf\uff0c\u6211\u8fd8\u662f\u9700\u8981\u4e00\u4e9b\u5f02\u5e38\uff0c\u62a5\u9519\u7b49\u95ee\u9898\u6765\u4e30\u5bcc\u5185\u5bb9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u5929\uff0c\u5c31\u6709\u7f51\u53cb\u9047\u5230\u4e86\u4e00\u4e2a OAuth2 \u4e2d\u7684\u5f02\u5e38\u3002A redirect_uri can only be used by implicit or authorization_code grant types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u5f02\u5e38\u7684\u5927\u81f4\u610f\u601d\u662f\u8bf4\uff1a\u91cd\u5b9a\u5411 uri \u53ea\u80fd\u7531\u9690\u5f0f\u6216\u6388\u6743\u4ee3\u7801\u7c7b\u578b\u4f7f\u7528\u3002\u8bf4\u767d\u4e86\uff0c\u5c31\u662f redirect_uri \u53ea\u6709\u5728 implicit\uff08\u7b80\u5316\u6a21\u5f0f\uff09\u548c authorization_code\uff08\u6388\u6743\u7801\u6a21\u5f0f\uff09\u4e0b\u624d\u6709\u7528\u3002\u5728\u5176\u5b83\u6a21\u5f0f\u4e0b\u914d\u7f6e\u7684 redirect_uri \u662f\u4e0d\u751f\u6548\u7684\uff0c\u56e0\u6b64\u5c31\u4f1a\u629b\u51fa\u8fd9\u4e2a\u5f02\u5e38\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u672c\u539f\u56e0\u5c31\u662f\uff0c\u4f60\u4f7f\u7528\u7684 grant_type \u8981\u4e48\u914d\u7f6e\u9519\u8bef\u4e86\uff0c\u8981\u4e0d\u5c31\u662f grant_type \u914d\u7f6e\u6b63\u786e\u4e86\uff0c\u4f46\u662f grant_type \u5bf9\u5e94\u7684\u6a21\u5f0f\u662f\u4e0d\u9700\u8981 redirect_uri \u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\uff0c\u5e0c\u671b\u80fd\u591f\u5e2e\u52a9\u5230\u5927\u5bb6\uff0c\u5982\u679c\u8fd8\u6709\u5176\u5b83\u7684\u95ee\u9898\uff0c\u6216\u8005\u9700\u8981 OAuth2 \u7684\u6559\u7a0b\u6e90\u7801\uff0c\u89c6\u9891\u6559\u7a0b\u7b49\uff0c\u53ef\u4ee5\u52a0\u6211\u5fae\u4fe1\uff0c\u514d\u8d39\u83b7\u53d6\uff01<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4879\">A redirect_uri can only be used by implicit or authorization_code grant types.<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\u4e0d\u5c11\u4eba\u53cd\u9988\u8bf4\uff0c\u6211\u7f51\u7ad9\u4e0a\u4e3a\u4ec0\u4e48\u7ecf\u5e38\u4f1a\u6709\u4e00\u4e9b\u4e71\u4e03\u516b\u7cdf\u7684\u6587\u7ae0\u3002\u6bd4\u5982\u672c\u6587\uff0c\u770b\u8d77\u6765\u5b8c\u5168\u6742\u4e71\u65e0\u7ae0\u3002 \u8fd9\u4e9b\u7f51\u53cb\u7684\u610f\u89c1\u6211 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[422,1892,2084,1001,182],"class_list":["post-4879","post","type-post","status-publish","format-standard","hentry","category-java","tag-authenticationtoken","tag-authorizationcodeservices","tag-authorizationendpoint","tag-oauth2","tag-oauth"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4879"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4879\/revisions"}],"predecessor-version":[{"id":4880,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4879\/revisions\/4880"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}