{"id":3734,"date":"2019-01-15T16:07:10","date_gmt":"2019-01-15T08:07:10","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3734"},"modified":"2019-01-15T16:07:10","modified_gmt":"2019-01-15T08:07:10","slug":"spring-security-oauth2-%e4%b8%ad-enableauthorizationserver-%e4%bd%bf%e7%94%a8%e6%95%b0%e6%8d%ae%e5%ba%93%e5%ad%98%e5%82%a8%e6%8e%88%e6%9d%83%e7%a0%81%ef%bc%8c%e4%bb%a4%e7%89%8c%e7%ad%89%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3734","title":{"rendered":"spring-security-oauth2 \u4e2d @EnableAuthorizationServer \u4f7f\u7528\u6570\u636e\u5e93\u5b58\u50a8\u6388\u6743\u7801\uff0c\u4ee4\u724c\u7b49\u4fe1\u606f"},"content":{"rendered":"<p>\n\t\u524d\u9762\u7684\u6587\u7ae0\uff0c\u5927\u5bb6\u53ef\u80fd\u90fd\u6ce8\u610f\u5230\u4e86\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u3002\u90a3\u5c31\u662f oauth_client \u548c oauth_client_secret \u90fd\u662f\u5199\u6b7b\u7684\u3002\u5728\u5fae\u4fe1\u548c QQ \u5f00\u53d1\u8005\u6388\u6743\u767b\u5f55\u7684\u540e\u53f0\uff0c\u6ca1\u65b0\u6ce8\u518c\u4e00\u4e2a\u5e94\u7528\uff0c\u53ea\u9700\u8981\u505a\u7b80\u5355\u7684\u914d\u7f6e\u4e00\u4e0b\u5373\u53ef\u3002\u5982\u679c\u5199\u6b7b\u4e86\uff0c\u90a3\u4e48\u65b0\u6765\u7684\u5e94\u7528\u600e\u4e48\u529e\uff1f\u8be5\u914d\u7f6e\u5417\uff1f\u4e0d\u73b0\u5b9e\u5427\u3002\n<\/p>\n<p>\n\t\u6240\u4ee5\u5728 spring-security-oauth2 \u4e2d\u6709\u4e00\u4e2a ClientDetailsServiceConfigurer\uff0c\u6211\u4eec\u53ef\u4ee5\u501f\u52a9\u5b83\u8bbe\u7f6e\u4e00\u4e2a\u6570\u636e\u6e90\u3002\u628a\u6388\u6743\u7801\uff0c\u4ee4\u724c\uff0c\u5ba2\u6237\u7aef\u4fe1\u606f\u7b49\u5b58\u5165\u6570\u636e\u5e93\u3002\u50cf\u6211\u4eec\u4e0a\u4e00\u7ae0\u4e2d\u7528\u7684 InMemory\uff0c\u5e94\u7528\u5df2\u91cd\u542f\uff0c\u5c31\u65e0\u6cd5\u7528\u4e86\u3002\n<\/p>\n<p>\n\t\u6574\u4e2a\u4ee3\u7801\u8be5\u52a8\u975e\u5e38\u5c0f\uff0c\u53ea\u9700\u8981\u5728 OAuthAuthorizationConfig \u4e2d\u91cd\u5199\u90e8\u5206\u65b9\u6cd5\u5373\u53ef\u3002\n<\/p>\n<pre class=\"brush:java;\">\r\n@Configuration  \r\n@EnableAuthorizationServer  \r\nstatic class OAuthAuthorizationConfig extends AuthorizationServerConfigurerAdapter {  \r\n    @Autowired  \r\n    private Environment env;\r\n    @Bean  \r\n    public DataSource dataSource() {  \r\n        final DriverManagerDataSource dataSource = new DriverManagerDataSource();  \r\n        dataSource.setDriverClassName(env.getProperty(&quot;spring.datasource.driver-class-name&quot;));  \r\n        dataSource.setUrl(env.getProperty(&quot;spring.datasource.url&quot;));  \r\n        dataSource.setUsername(env.getProperty(&quot;spring.datasource.username&quot;));  \r\n        dataSource.setPassword(env.getProperty(&quot;spring.datasource.password&quot;));  \r\n        return dataSource;  \r\n    }  \r\n    @Bean  \r\n    public ApprovalStore approvalStore() {  \r\n        return new JdbcApprovalStore(dataSource());  \r\n    }  \r\n    @Bean  \r\n    protected AuthorizationCodeServices authorizationCodeServices() {  \r\n        return new JdbcAuthorizationCodeServices(dataSource());  \r\n    }  \r\n    @Bean  \r\n    public TokenStore tokenStore() {  \r\n        return new JdbcTokenStore(dataSource());  \r\n    }  \r\n    @Override  \r\n    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {  \r\n        clients.jdbc(dataSource()); \/\/ oauth_client_details  \r\n    }  \r\n    @Override  \r\n    public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {  \r\n        endpoints.approvalStore(approvalStore()) \/\/ oauth_approvals  \r\n         .authorizationCodeServices(authorizationCodeServices())    \/\/ oauth_code  \r\n         .tokenStore(tokenStore()); \/\/ oauth_access_token &amp; oauth_refresh_token  \r\n    }  \r\n}  <\/pre>\n<p>\n\tpom.xml \u4e2d\u5f15\u5165\u6570\u636e\u5e93\u9a71\u52a8\u914d\u7f6e\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;mysql&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;  \r\n    &lt;groupId&gt;org.springframework&lt;\/groupId&gt;  \r\n    &lt;artifactId&gt;spring-jdbc&lt;\/artifactId&gt;  \r\n&lt;\/dependency&gt;<\/pre>\n<p>\n\tapplication.yml \u4e2d\u7684\u914d\u7f6e\u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\nspring:\r\n&nbsp; &nbsp; datasource:\r\n&nbsp; &nbsp; &nbsp; &nbsp; host: 127.0.0.1\r\n&nbsp; &nbsp; &nbsp; &nbsp; port: 3306\r\n&nbsp; &nbsp; &nbsp; &nbsp; dbname: xttblog\r\n&nbsp; &nbsp; &nbsp; &nbsp; username: xttblog\r\n&nbsp; &nbsp; &nbsp; &nbsp; password: xttblog\r\n&nbsp; &nbsp; &nbsp; &nbsp; url: jdbc:mysql:\/\/${spring.datasource.host}:${spring.datasource.port}\/${spring.datasource.dbname}?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false\r\n&nbsp; &nbsp; &nbsp; &nbsp; initialSize: 1\r\n&nbsp; &nbsp; &nbsp; &nbsp; minIdle: 1\r\n&nbsp; &nbsp; &nbsp; &nbsp; maxActive: 4\r\n&nbsp; &nbsp; &nbsp; &nbsp; maxWait: 60000<\/pre>\n<p>\n\t\u6709\u6570\u636e\u5e93\u5c31\u6709\u6570\u636e\u8868\uff0c\u8fd9\u91cc\u603b\u5171\u6d89\u53ca\u5230 6 \u5f20\u8868\u3002SQL \u5982\u4e0b\uff1a\n<\/p>\n<pre class=\"brush:sql;\">\r\nCREATE TABLE oauth_access_token  \r\n(  \r\n  token_id character varying(256), -- MD5\u52a0\u5bc6\u7684access_token\u7684\u503c  \r\n  token bytea, -- OAuth2AccessToken.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e  \r\n  authentication_id character varying(256), -- MD5\u52a0\u5bc6\u8fc7\u7684username,client_id,scope  \r\n  user_name character varying(256), -- \u767b\u5f55\u7684\u7528\u6237\u540d  \r\n  client_id character varying(256), -- \u5ba2\u6237\u7aefID  \r\n  authentication bytea, -- OAuth2Authentication.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e  \r\n  refresh_token character varying(256) -- MD5\u52a0\u5bc6\u679c\u7684refresh_token\u7684\u503c  \r\n);  \r\nCOMMENT ON COLUMN oauth_access_token.token_id IS &#039;MD5\u52a0\u5bc6\u7684access_token\u7684\u503c&#039;;  \r\nCOMMENT ON COLUMN oauth_access_token.token IS &#039;OAuth2AccessToken.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e&#039;;  \r\nCOMMENT ON COLUMN oauth_access_token.authentication_id IS &#039;MD5\u52a0\u5bc6\u8fc7\u7684username,client_id,scope&#039;;  \r\nCOMMENT ON COLUMN oauth_access_token.user_name IS &#039;\u767b\u5f55\u7684\u7528\u6237\u540d&#039;;  \r\nCOMMENT ON COLUMN oauth_access_token.client_id IS &#039;\u5ba2\u6237\u7aefID&#039;;  \r\nCOMMENT ON COLUMN oauth_access_token.authentication IS &#039;OAuth2Authentication.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e&#039;;  \r\nCOMMENT ON COLUMN oauth_access_token.refresh_token IS &#039;MD5\u52a0\u5bc6\u679c\u7684refresh_token\u7684\u503c&#039;;  \r\n  \r\nCREATE TABLE oauth_approvals  \r\n(  \r\n  userid character varying(256), -- \u767b\u5f55\u7684\u7528\u6237\u540d  \r\n  clientid character varying(256), -- \u5ba2\u6237\u7aefID  \r\n  scope character varying(256), -- \u7533\u8bf7\u7684\u6743\u9650  \r\n  status character varying(10), -- \u72b6\u6001\uff08Approve\u6216Deny\uff09  \r\n  expiresat timestamp without time zone, -- \u8fc7\u671f\u65f6\u95f4  \r\n  lastmodifiedat timestamp without time zone -- \u6700\u7ec8\u4fee\u6539\u65f6\u95f4  \r\n);  \r\nCOMMENT ON COLUMN oauth_approvals.userid IS &#039;\u767b\u5f55\u7684\u7528\u6237\u540d&#039;;  \r\nCOMMENT ON COLUMN oauth_approvals.clientid IS &#039;\u5ba2\u6237\u7aefID&#039;;  \r\nCOMMENT ON COLUMN oauth_approvals.scope IS &#039;\u7533\u8bf7\u7684\u6743\u9650&#039;;  \r\nCOMMENT ON COLUMN oauth_approvals.status IS &#039;\u72b6\u6001\uff08Approve\u6216Deny\uff09&#039;;  \r\nCOMMENT ON COLUMN oauth_approvals.expiresat IS &#039;\u8fc7\u671f\u65f6\u95f4&#039;;  \r\nCOMMENT ON COLUMN oauth_approvals.lastmodifiedat IS &#039;\u6700\u7ec8\u4fee\u6539\u65f6\u95f4&#039;;  \r\n  \r\nCREATE TABLE oauth_client_details  \r\n(  \r\n  client_id character varying(256) NOT NULL, -- \u5ba2\u6237\u7aefID  \r\n  resource_ids character varying(256), -- \u8d44\u6e90ID\u96c6\u5408,\u591a\u4e2a\u8d44\u6e90\u65f6\u7528\u9017\u53f7(,)\u5206\u9694  \r\n  client_secret character varying(256), -- \u5ba2\u6237\u7aef\u5bc6\u5319  \r\n  scope character varying(256), -- \u5ba2\u6237\u7aef\u7533\u8bf7\u7684\u6743\u9650\u8303\u56f4  \r\n  authorized_grant_types character varying(256), -- \u5ba2\u6237\u7aef\u652f\u6301\u7684grant_type  \r\n  web_server_redirect_uri character varying(256), -- \u91cd\u5b9a\u5411URI  \r\n  authorities character varying(256), -- \u5ba2\u6237\u7aef\u6240\u62e5\u6709\u7684Spring Security\u7684\u6743\u9650\u503c\uff0c\u591a\u4e2a\u7528\u9017\u53f7(,)\u5206\u9694  \r\n  access_token_validity integer, -- \u8bbf\u95ee\u4ee4\u724c\u6709\u6548\u65f6\u95f4\u503c(\u5355\u4f4d:\u79d2)  \r\n  refresh_token_validity integer, -- \u66f4\u65b0\u4ee4\u724c\u6709\u6548\u65f6\u95f4\u503c(\u5355\u4f4d:\u79d2)  \r\n  additional_information character varying(4096), -- \u9884\u7559\u5b57\u6bb5  \r\n  autoapprove character varying(256), -- \u7528\u6237\u662f\u5426\u81ea\u52a8Approval\u64cd\u4f5c  \r\n  CONSTRAINT oauth_client_details_pkey PRIMARY KEY (client_id)  \r\n);  \r\nCOMMENT ON COLUMN oauth_client_details.client_id IS &#039;\u5ba2\u6237\u7aefID&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.resource_ids IS &#039;\u8d44\u6e90ID\u96c6\u5408,\u591a\u4e2a\u8d44\u6e90\u65f6\u7528\u9017\u53f7(,)\u5206\u9694&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.client_secret IS &#039;\u5ba2\u6237\u7aef\u5bc6\u5319&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.scope IS &#039;\u5ba2\u6237\u7aef\u7533\u8bf7\u7684\u6743\u9650\u8303\u56f4&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.authorized_grant_types IS &#039;\u5ba2\u6237\u7aef\u652f\u6301\u7684grant_type&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.web_server_redirect_uri IS &#039;\u91cd\u5b9a\u5411URI&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.authorities IS &#039;\u5ba2\u6237\u7aef\u6240\u62e5\u6709\u7684Spring Security\u7684\u6743\u9650\u503c\uff0c\u591a\u4e2a\u7528\u9017\u53f7(,)\u5206\u9694&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.access_token_validity IS &#039;\u8bbf\u95ee\u4ee4\u724c\u6709\u6548\u65f6\u95f4\u503c(\u5355\u4f4d:\u79d2)&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.refresh_token_validity IS &#039;\u66f4\u65b0\u4ee4\u724c\u6709\u6548\u65f6\u95f4\u503c(\u5355\u4f4d:\u79d2)&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.additional_information IS &#039;\u9884\u7559\u5b57\u6bb5&#039;;  \r\nCOMMENT ON COLUMN oauth_client_details.autoapprove IS &#039;\u7528\u6237\u662f\u5426\u81ea\u52a8Approval\u64cd\u4f5c&#039;;  \r\n  \r\nCREATE TABLE oauth_client_token  \r\n(  \r\n  token_id character varying(256), -- MD5\u52a0\u5bc6\u7684access_token\u503c  \r\n  token bytea, -- OAuth2AccessToken.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e  \r\n  authentication_id character varying(256), -- MD5\u52a0\u5bc6\u8fc7\u7684username,client_id,scope  \r\n  user_name character varying(256), -- \u767b\u5f55\u7684\u7528\u6237\u540d  \r\n  client_id character varying(256) -- \u5ba2\u6237\u7aefID  \r\n);  \r\nCOMMENT ON COLUMN oauth_client_token.token_id IS &#039;MD5\u52a0\u5bc6\u7684access_token\u503c&#039;;  \r\nCOMMENT ON COLUMN oauth_client_token.token IS &#039;OAuth2AccessToken.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e&#039;;  \r\nCOMMENT ON COLUMN oauth_client_token.authentication_id IS &#039;MD5\u52a0\u5bc6\u8fc7\u7684username,client_id,scope&#039;;  \r\nCOMMENT ON COLUMN oauth_client_token.user_name IS &#039;\u767b\u5f55\u7684\u7528\u6237\u540d&#039;;  \r\nCOMMENT ON COLUMN oauth_client_token.client_id IS &#039;\u5ba2\u6237\u7aefID&#039;;  \r\n  \r\nCREATE TABLE oauth_code  \r\n(  \r\n  code character varying(256), -- \u6388\u6743\u7801(\u672a\u52a0\u5bc6)  \r\n  authentication bytea -- AuthorizationRequestHolder.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e  \r\n);  \r\nCOMMENT ON COLUMN oauth_code.code IS &#039;\u6388\u6743\u7801(\u672a\u52a0\u5bc6)&#039;;  \r\nCOMMENT ON COLUMN oauth_code.authentication IS &#039;AuthorizationRequestHolder.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e&#039;;  \r\n  \r\nCREATE TABLE oauth_refresh_token  \r\n(  \r\n  token_id character varying(256), -- MD5\u52a0\u5bc6\u8fc7\u7684refresh_token\u7684\u503c  \r\n  token bytea, -- OAuth2RefreshToken.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e  \r\n  authentication bytea -- OAuth2Authentication.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e  \r\n);  \r\nCOMMENT ON COLUMN oauth_refresh_token.token_id IS &#039;MD5\u52a0\u5bc6\u8fc7\u7684refresh_token\u7684\u503c&#039;;  \r\nCOMMENT ON COLUMN oauth_refresh_token.token IS &#039;OAuth2RefreshToken.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e&#039;;  \r\nCOMMENT ON COLUMN oauth_refresh_token.authentication IS &#039;OAuth2Authentication.java\u5bf9\u8c61\u5e8f\u5217\u5316\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e&#039;;  <\/pre>\n<p>\n\t\u89e3\u91ca\u5982\u4e0b\uff1a\n<\/p>\n<ul>\n<li>\n\t\toauth_access_token\uff1a\u8bbf\u95ee\u4ee4\u724c\n\t<\/li>\n<li>\n\t\toauth_refresh_token\uff1a\u66f4\u65b0\u4ee4\u724c\n\t<\/li>\n<li>\n\t\toauth_client_details\uff1a\u5ba2\u6237\u7aef\u4fe1\u606f\n\t<\/li>\n<li>\n\t\toauth_code\uff1a\u6388\u6743\u7801\n\t<\/li>\n<li>\n\t\toauth_approvals\uff1a\u6388\u6743\u8bb0\u5f55\n\t<\/li>\n<li>\n\t\toauth_client_token\uff1a\u8fd9\u5f20\u8868\u6bd4\u8f83\u7279\u6b8a\uff0c\u4e0d\u7528\u4e8e Provider\uff0c\u662f\u5ba2\u6237\u7aef\u7528\u7684\n\t<\/li>\n<\/ul>\n<p>\n\t\u6211\u4eec\u5148\u624b\u52a8\u63d2\u5165\u4e00\u6761\u6570\u636e\uff0c\u5c31\u53ef\u4ee5\u6d4b\u8bd5\u6211\u4eec\u7684\u6388\u6743\u529f\u80fd\u4e86\u3002\n<\/p>\n<pre class=\"brush:sql;\">\r\nINSERT INTO oauth_client_details(client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove)  \r\n    VALUES (&#039;oauth_client&#039;, null, &#039;oauth_client_secret&#039;, &#039;read,write&#039;, &#039;authorization_code,refresh_token&#039;, &#039;http:\/\/www.xttblog.com&#039;, &#039;ROLE_USER&#039;, 1800, 86400, null, false);<\/pre>\n<h2>\n\t\u53c2\u8003\u8d44\u6599<br \/>\n<\/h2>\n<ul>\n<li>\n\t\t<a href=\"https:\/\/github.com\/spring-projects\/spring-security-oauth\/blob\/master\/spring-security-oauth2\/src\/test\/resources\/schema.sql\">https:\/\/github.com\/spring-projects\/spring-security-oauth\/blob\/master\/spring-security-oauth2\/src\/test\/resources\/schema.sql<\/a>\n\t<\/li>\n<\/ul>\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=3734\">spring-security-oauth2 \u4e2d @EnableAuthorizationServer \u4f7f\u7528\u6570\u636e\u5e93\u5b58\u50a8\u6388\u6743\u7801\uff0c\u4ee4\u724c\u7b49\u4fe1\u606f<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u524d\u9762\u7684\u6587\u7ae0\uff0c\u5927\u5bb6\u53ef\u80fd\u90fd\u6ce8\u610f\u5230\u4e86\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u3002\u90a3\u5c31\u662f oauth_client \u548c oauth_client_s [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1887,1891,1888,1889,1890],"class_list":["post-3734","post","type-post","status-publish","format-standard","hentry","category-yyzt","tag-enableauthorizationserver","tag-approvalstore","tag-authorizationserverconfigureradapter","tag-clientdetailsserviceconfigurer","tag-jdbctokenstore"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3734","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=3734"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3734\/revisions"}],"predecessor-version":[{"id":3735,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3734\/revisions\/3735"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}