{"id":13802,"date":"2025-04-18T20:42:54","date_gmt":"2025-04-18T12:42:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/13802.html"},"modified":"2025-04-18T20:42:54","modified_gmt":"2025-04-18T12:42:54","slug":"%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e6%90%ad%e5%bb%ba%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8eoauth2-1%e8%a7%84%e8%8c%83%e7%9a%84%e6%8e%88%e6%9d%83%e8%ae%a4%e8%af%81%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/13802.html","title":{"rendered":"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801"},"content":{"rendered":"<h3>\u524d\u8a00<\/h3>\n<p>\u6280\u672f\u66f4\u65b0\uff1aSpring Security OAuth\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u800cSpring Authorization Server\u662f\u5176\u5b98\u65b9\u63a8\u8350\u7684\u66ff\u4ee3\u65b9\u6848\u3002\u5b83\u63d0\u4f9b\u4e86\u66f4\u73b0\u4ee3\u3001\u66f4\u5b89\u5168\u7684\u6388\u6743\u670d\u52a1\u5668\u5b9e\u73b0\uff0c\u7b26\u5408\u6700\u65b0\u7684OAuth 2.1\u89c4\u8303\u3002<\/p>\n<p>\u9879\u76ee\u9700\u6c42\uff1a\u5c0f\u7070\u5de5\u4f5c\u4e0a\u7684\u9879\u76ee\u9700\u8981\u642d\u5efa\u4e00\u4e2a\u6388\u6743\u670d\u52a1\u5668\uff0c\u800c\u539f\u5148\u4f7f\u7528\u7684Spring Security OAuth\uff0c\u800c\u8be5\u9879\u76ee\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u867d\u7136\u7f51\u4e0a\u6709\u5f88\u591a\u76f8\u5173\u6559\u7a0b\u548c\u8d44\u6599\uff0c\u4f46\u8003\u8651\u5230\u6280\u672f\u7684\u66f4\u65b0\u8fed\u4ee3\uff0c\u51b3\u5b9a\u91c7\u7528Spring Authorization Server\u6765\u5b9e\u73b0\u3002<\/p>\n<p>\u529f\u80fd\u5b9e\u73b0\uff1a\u8be5\u9879\u76ee\u5305\u62ec\u8ba4\u8bc1\u6388\u6743\u4e2d\u5fc3\u3001\u8d44\u6e90\u670d\u52a1\u5668\u3001\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u7aef\u3002\u901a\u8fc7\u4f7f\u7528Spring Authorization Server\uff0c\u53ef\u4ee5\u786e\u4fdd\u8fd9\u4e9b\u529f\u80fd\u7684\u5b89\u5168\u6027\u548c\u53ef\u9760\u6027\uff0c\u540c\u65f6\u9075\u5faa\u6700\u65b0\u7684\u5b89\u5168\u6807\u51c6\u3002<\/p>\n<h3>\u9879\u76ee\u529f\u80fd<\/h3>\n<p>\u6388\u6743\u4e2d\u5fc3Server\uff1a\u8fdb\u884c\u8ba4\u8bc1\u3001\u6388\u6743\uff0c\u5e76\u53d1\u653etoken\u3001\u5237\u65b0token\uff0c\u4e0d\u8d1f\u8d23token\u9274\u6743(\u7531\u8d44\u6e90\u670d\u52a1\u5668\u81ea\u884c\u9274\u6743)\uff1b<\/p>\n<p>\u5ba2\u6237\u7aefClient\uff1a\u9762\u5411\u7528\u6237\u7684\u64cd\u4f5c\u5165\u53e3\uff1b\u5411Server\u8bf7\u6c42token\uff0c\u643a\u5e26token\u8bbf\u95eeResource\uff1b<\/p>\n<p>\u8d44\u6e90\u670d\u52a1\u5668Resource\uff1a\u63d0\u4f9b\u8d44\u6e90\uff0c\u9700\u8981\u643a\u5e26token\u8bf7\u6c42\uff0c\u53ef\u4ee5\u81ea\u884c\u9274\u6743\uff1b<\/p>\n<h3>\u9879\u76ee\u7ed3\u6784<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418124253-680248cd78d2d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"><\/p>\n<h3>\u9879\u76ee\u642d\u5efa<\/h3>\n<p>\u8bf4\u660e\uff1a\u9879\u76ee\u76f8\u5173\u67b6\u5305\u3001\u6570\u636e\u5e93\u811a\u672c\u76f8\u5173\u4fe1\u606f\u5728\u9879\u76ee\u91cc\uff0c\u5177\u4f53\u53ef\u94fe\u63a5\u4e0b\u8f7d\u3002<\/p>\n<p>\u6388\u6743\u4e2d\u5fc3Server\uff08spring-authorization-server\uff09\uff1a<\/p>\n<p>application.yaml<\/p>\n<p><span class=\"token key atrule\">server<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">port<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">9000<\/span><br \/>\n  <span class=\"token key atrule\">servlet<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">session<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">cookie<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> OAuth<span class=\"token punctuation\">&#8211;<\/span>Auth<span class=\"token punctuation\">&#8211;<\/span>Server<br \/>\n<span class=\"token key atrule\">logging<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">level<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">root<\/span><span class=\"token punctuation\">:<\/span> info<br \/>\n    <span class=\"token key atrule\">org.springframework.web<\/span><span class=\"token punctuation\">:<\/span> info<br \/>\n    <span class=\"token key atrule\">org.springframework.security<\/span><span class=\"token punctuation\">:<\/span> trace<br \/>\n    <span class=\"token key atrule\">org.springframework.security.oauth2<\/span><span class=\"token punctuation\">:<\/span> trace<br \/>\n<span class=\"token key atrule\">spring<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">thymeleaf<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">cache<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token boolean important\">false<\/span><br \/>\n    <span class=\"token key atrule\">prefix<\/span><span class=\"token punctuation\">:<\/span> classpath<span class=\"token punctuation\">:<\/span>\/templates<br \/>\n<span class=\"token comment\">#    check-template-location: true<\/span><br \/>\n    <span class=\"token key atrule\">suffix<\/span><span class=\"token punctuation\">:<\/span> .html<br \/>\n    <span class=\"token key atrule\">mode<\/span><span class=\"token punctuation\">:<\/span> HTML<br \/>\n  <span class=\"token key atrule\">datasource<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">driver-class-name<\/span><span class=\"token punctuation\">:<\/span> com.mysql.cj.jdbc.Driver<br \/>\n    <span class=\"token key atrule\">url<\/span><span class=\"token punctuation\">:<\/span> jdbc<span class=\"token punctuation\">:<\/span>mysql<span class=\"token punctuation\">:<\/span>\/\/ip<span class=\"token punctuation\">:<\/span>3306\/oauth2.0<span class=\"token punctuation\">?<\/span>useUnicode=true<span class=\"token important\">&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=true&amp;serverTimezone=GMT%2B8<\/span><br \/>\n    <span class=\"token key atrule\">username<\/span><span class=\"token punctuation\">:<\/span> root<br \/>\n    <span class=\"token key atrule\">password<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token important\">********<\/span><\/p>\n<p>\u65b0\u5efaAuthorizationServer\u76f8\u5173\u914d\u7f6e<\/p>\n<p><span class=\"token annotation punctuation\">@Configuration<\/span><br \/>\n<span class=\"token annotation punctuation\">@EnableWebSecurity<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">AuthorizationServerConfig<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">@Autowired<\/span><br \/>\n    <span class=\"token keyword\">private<\/span> <span class=\"token class-name\">PasswordEncoder<\/span> passwordEncoder<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/**<br \/>\n     * \u6388\u6743\u670d\u52a1\u5668 SecurityFilterChain<br \/>\n     * @param http<br \/>\n     * @return<br \/>\n     * @throws Exception<br \/>\n     *\/<\/span><br \/>\n    <span class=\"token annotation punctuation\">@Bean<\/span><br \/>\n    <span class=\"token annotation punctuation\">@Order<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Ordered<\/span><span class=\"token punctuation\">.<\/span>HIGHEST_PRECEDENCE<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">SecurityFilterChain<\/span> <span class=\"token function\">authorizationServerSecurityFilterChain<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">HttpSecurity<\/span> http<span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">Exception<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n        <span class=\"token class-name\">OAuth2AuthorizationServerConfiguration<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">applyDefaultSecurity<\/span><span class=\"token punctuation\">(<\/span>http<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        http<span class=\"token punctuation\">.<\/span><span class=\"token function\">getConfigurer<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">OAuth2AuthorizationServerConfigurer<\/span><span class=\"token punctuation\">.<\/span><span class=\"token keyword\">class<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token punctuation\">.<\/span><span class=\"token function\">oidc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Customizer<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">withDefaults<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ Enable OpenID Connect 1.0<\/span><\/p>\n<p>        http<br \/>\n                <span class=\"token comment\">\/\/ \u672a\u4ece\u6388\u6743\u7ec8\u7ed3\u70b9\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u65f6\u91cd\u5b9a\u5411\u5230\u767b\u5f55\u9875\u9762<\/span><br \/>\n                <span class=\"token punctuation\">.<\/span><span class=\"token function\">exceptionHandling<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>exceptions<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">-&gt;<\/span> exceptions<br \/>\n                        <span class=\"token punctuation\">.<\/span><span class=\"token function\">defaultAuthenticationEntryPointFor<\/span><span class=\"token punctuation\">(<\/span><br \/>\n                                <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">LoginUrlAuthenticationEntryPoint<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;\/login\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n                                <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">MediaTypeRequestMatcher<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">MediaType<\/span><span class=\"token punctuation\">.<\/span>TEXT_HTML<span class=\"token punctuation\">)<\/span><br \/>\n                        <span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token comment\">\/\/ \u63a5\u53d7\u7528\u6237\u4fe1\u606f\u548c\/\u6216\u5ba2\u6237\u7aef\u6ce8\u518c\u7684\u8bbf\u95ee\u4ee4\u724c<\/span><br \/>\n                <span class=\"token punctuation\">.<\/span><span class=\"token function\">oauth2ResourceServer<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>resourceServer<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">-&gt;<\/span> resourceServer<br \/>\n                        <span class=\"token punctuation\">.<\/span><span class=\"token function\">jwt<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Customizer<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">withDefaults<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token keyword\">return<\/span> http<span class=\"token punctuation\">.<\/span><span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/**<br \/>\n     * \u914d\u7f6e\u8ba4\u8bc1\u76f8\u5173\u7684\u8fc7\u6ee4\u5668\u94fe<br \/>\n     *<br \/>\n     * @param http spring security\u6838\u5fc3\u914d\u7f6e\u7c7b<br \/>\n     * @return \u8fc7\u6ee4\u5668\u94fe<br \/>\n     * @throws Exception \u629b\u51fa<br \/>\n     *\/<\/span><br \/>\n    <span class=\"token annotation punctuation\">@Bean<\/span><br \/>\n    <span class=\"token annotation punctuation\">@Order<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token class-name\">SecurityFilterChain<\/span> <span class=\"token function\">defaultSecurityFilterChain<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">HttpSecurity<\/span> http<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">Exception<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n        http<span class=\"token punctuation\">.<\/span><span class=\"token function\">authorizeHttpRequests<\/span><span class=\"token punctuation\">(<\/span>authorizeRequests <span class=\"token operator\">-&gt;<\/span><br \/>\n                authorizeRequests<br \/>\n                <span class=\"token comment\">\/\/ \u5141\u8bb8\u7684\u8bf7\u6c42<\/span><br \/>\n                <span class=\"token punctuation\">.<\/span><span class=\"token function\">requestMatchers<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">HttpMethod<\/span><span class=\"token punctuation\">.<\/span>GET<span class=\"token punctuation\">,<\/span> <span class=\"token string\">\\&#8221;\/test\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u6280\u672f\u66f4\u65b0\uff1aSpring Security OAuth\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u800cSpring Authorization Server\u662f\u5176\u5b98\u65b9\u63a8\u8350\u7684\u66ff\u4ee3\u65b9\u6848\u3002\u5b83\u63d0\u4f9b\u4e86\u66f4\u73b0\u4ee3\u3001\u66f4\u5b89\u5168\u7684\u6388\u6743\u670d\u52a1\u5668\u5b9e\u73b0\uff0c\u7b26\u5408\u6700\u65b0\u7684OAuth 2.1\u89c4\u8303\u3002\u9879\u76ee\u9700\u6c42\uff1a\u5c0f\u7070\u5de5\u4f5c\u4e0a\u7684\u9879\u76ee\u9700\u8981\u642d\u5efa\u4e00\u4e2a\u6388\u6743\u670d\u52a1\u5668\uff0c\u800c\u539f\u5148\u4f7f\u7528\u7684Spring Security OAuth\uff0c\u800c\u8be5\u9879\u76ee\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u867d\u7136\u7f51\u4e0a\u6709\u5f88\u591a\u76f8\u5173\u6559\u7a0b\u548c\u8d44\u6599\uff0c\u4f46\u8003\u8651\u5230\u6280\u672f\u7684\u66f4\u65b0\u8fed\u4ee3\uff0c\u51b3\u5b9a\u91c7\u7528Spring Authorization Server\u6765\u5b9e\u73b0\u3002\u529f\u80fd\u5b9e\u73b0\u3002_oauth 2.1<\/p>\n","protected":false},"author":2,"featured_media":13801,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,101,850,98],"topic":[],"class_list":["post-13802","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-spring","tag-spring-authorization-server","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801 - \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\/13802.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u6280\u672f\u66f4\u65b0\uff1aSpring Security OAuth\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u800cSpring Authorization Server\u662f\u5176\u5b98\u65b9\u63a8\u8350\u7684\u66ff\u4ee3\u65b9\u6848\u3002\u5b83\u63d0\u4f9b\u4e86\u66f4\u73b0\u4ee3\u3001\u66f4\u5b89\u5168\u7684\u6388\u6743\u670d\u52a1\u5668\u5b9e\u73b0\uff0c\u7b26\u5408\u6700\u65b0\u7684OAuth 2.1\u89c4\u8303\u3002\u9879\u76ee\u9700\u6c42\uff1a\u5c0f\u7070\u5de5\u4f5c\u4e0a\u7684\u9879\u76ee\u9700\u8981\u642d\u5efa\u4e00\u4e2a\u6388\u6743\u670d\u52a1\u5668\uff0c\u800c\u539f\u5148\u4f7f\u7528\u7684Spring Security OAuth\uff0c\u800c\u8be5\u9879\u76ee\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u867d\u7136\u7f51\u4e0a\u6709\u5f88\u591a\u76f8\u5173\u6559\u7a0b\u548c\u8d44\u6599\uff0c\u4f46\u8003\u8651\u5230\u6280\u672f\u7684\u66f4\u65b0\u8fed\u4ee3\uff0c\u51b3\u5b9a\u91c7\u7528Spring Authorization Server\u6765\u5b9e\u73b0\u3002\u529f\u80fd\u5b9e\u73b0\u3002_oauth 2.1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/13802.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-18T12:42:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418124253-680248cd78d2d.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\/13802.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/13802.html\",\"name\":\"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T12:42:54+00:00\",\"dateModified\":\"2025-04-18T12:42:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/13802.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/13802.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/13802.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801\"}]},{\"@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":"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801 - \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\/13802.html","og_locale":"zh_CN","og_type":"article","og_title":"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf7\u6b21\u3002\u6280\u672f\u66f4\u65b0\uff1aSpring Security OAuth\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u800cSpring Authorization Server\u662f\u5176\u5b98\u65b9\u63a8\u8350\u7684\u66ff\u4ee3\u65b9\u6848\u3002\u5b83\u63d0\u4f9b\u4e86\u66f4\u73b0\u4ee3\u3001\u66f4\u5b89\u5168\u7684\u6388\u6743\u670d\u52a1\u5668\u5b9e\u73b0\uff0c\u7b26\u5408\u6700\u65b0\u7684OAuth 2.1\u89c4\u8303\u3002\u9879\u76ee\u9700\u6c42\uff1a\u5c0f\u7070\u5de5\u4f5c\u4e0a\u7684\u9879\u76ee\u9700\u8981\u642d\u5efa\u4e00\u4e2a\u6388\u6743\u670d\u52a1\u5668\uff0c\u800c\u539f\u5148\u4f7f\u7528\u7684Spring Security OAuth\uff0c\u800c\u8be5\u9879\u76ee\u5df2\u7ecf\u9010\u6e10\u88ab\u6dd8\u6c70\uff0c\u867d\u7136\u7f51\u4e0a\u6709\u5f88\u591a\u76f8\u5173\u6559\u7a0b\u548c\u8d44\u6599\uff0c\u4f46\u8003\u8651\u5230\u6280\u672f\u7684\u66f4\u65b0\u8fed\u4ee3\uff0c\u51b3\u5b9a\u91c7\u7528Spring Authorization Server\u6765\u5b9e\u73b0\u3002\u529f\u80fd\u5b9e\u73b0\u3002_oauth 2.1","og_url":"https:\/\/www.wsisp.com\/helps\/13802.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T12:42:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418124253-680248cd78d2d.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\/13802.html","url":"https:\/\/www.wsisp.com\/helps\/13802.html","name":"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T12:42:54+00:00","dateModified":"2025-04-18T12:42:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/13802.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/13802.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/13802.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u624b\u628a\u624b\u6559\u4f60\u642d\u5efa\u4e00\u4e2a\u57fa\u4e8eOAuth2.1\u89c4\u8303\u7684\u6388\u6743\u8ba4\u8bc1\u670d\u52a1\u5668\uff08\u4e00\uff09\uff1a\u9644\u6e90\u7801"}]},{"@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\/13802","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=13802"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/13802\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/13801"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=13802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=13802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=13802"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=13802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}