{"id":18800,"date":"2021-10-22T05:55:01","date_gmt":"2021-10-21T22:55:01","guid":{"rendered":"https:\/\/huongdanjava.com\/?p=18800"},"modified":"2023-12-23T11:08:22","modified_gmt":"2023-12-23T04:08:22","slug":"store-registeredclient-to-database-in-spring-authorization-server","status":"publish","type":"post","link":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html","title":{"rendered":"Store RegisteredClient to database in Spring Authorization Server"},"content":{"rendered":"<p>In <a href=\"https:\/\/huongdanjava.com\/implement-oauth-authorization-server-using-spring-authorization-server.html\" target=\"_blank\" rel=\"noopener\">the previous tutorial<\/a>, I showed you how to implement an Authorization Server using Spring Authorization Server, but the information about RegisteredClient in this tutorial is stored in memory. To store RegisteredClient information in the database, how will we do it? In this tutorial, I will show you how to do this!<\/p>\n<p>First, I also created a new Spring Boot project with Spring Web Starter, Spring Security Starter, Spring Data JPA, PostgreSQL Driver and OAuth2 Authorization Server Starter::<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22736 size-full aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/10\/store-registeredclient-to-database-in-spring-authorization-server-1.png\" alt=\"\" width=\"700\" height=\"857\" \/><\/p>\n<p>for example.<\/p>\n<p>Result:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-21894 size-full aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/10\/store-registeredclient-to-database-in-spring-authorization-server-2.png\" alt=\"\" width=\"700\" height=\"387\" \/><\/p>\n<p>I will configure Spring Security as in the tutorial\u00a0<a href=\"https:\/\/huongdanjava.com\/implement-oauth-authorization-server-using-spring-authorization-server.html\" target=\"_blank\" rel=\"noopener\">Implement OAuth Authorization Server using Spring Authorization Server<\/a> as follows:<\/p>\n<pre class=\"lang:java decode:true\">package com.huongdanjava.springauthorizationserver;\r\n\r\nimport org.springframework.context.annotation.Bean;\r\nimport org.springframework.context.annotation.Configuration;\r\nimport org.springframework.security.config.Customizer;\r\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\r\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\r\nimport org.springframework.security.core.userdetails.User;\r\nimport org.springframework.security.core.userdetails.UserDetails;\r\nimport org.springframework.security.core.userdetails.UserDetailsService;\r\nimport org.springframework.security.provisioning.InMemoryUserDetailsManager;\r\nimport org.springframework.security.web.SecurityFilterChain;\r\n\r\n@Configuration\r\n@EnableWebSecurity\r\npublic class SpringSecurityConfiguration {\r\n\r\n  @Bean\r\n  SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception {\r\n    \/\/ @formatter:off\r\n    http\r\n        .authorizeHttpRequests(authorizeRequests -&gt;\r\n            authorizeRequests.anyRequest().authenticated()\r\n        )\r\n        .formLogin(Customizer.withDefaults());\r\n    \/\/ @formatter:on\r\n\r\n    return http.build();\r\n  }\r\n\r\n  @Bean\r\n  public UserDetailsService users() {\r\n    \/\/ @formatter:off\r\n    UserDetails user = User.withDefaultPasswordEncoder()\r\n        .username(\"admin\")\r\n        .password(\"password\")\r\n        .roles(\"ADMIN\").build();\r\n    \/\/ @formatter:on\r\n\r\n    return new InMemoryUserDetailsManager(user);\r\n  }\r\n\r\n}\r\n<\/pre>\n<p>As for the configuration for the Authorization Server, I also do the same as the tutorial <a href=\"https:\/\/huongdanjava.com\/implement-oauth-authorization-server-using-spring-authorization-server.html\" target=\"_blank\" rel=\"noopener\">Implement OAuth Authorization Server using Spring Authorization Server<\/a>, but I will declare the RegisteredClient information later:<\/p>\n<pre class=\"lang:java decode:true\">package com.huongdanjava.springauthorizationserver;\r\n\r\nimport java.security.KeyPair;\r\nimport java.security.KeyPairGenerator;\r\nimport java.security.NoSuchAlgorithmException;\r\nimport java.security.interfaces.RSAPrivateKey;\r\nimport java.security.interfaces.RSAPublicKey;\r\nimport java.util.UUID;\r\nimport org.springframework.context.annotation.Bean;\r\nimport org.springframework.context.annotation.Configuration;\r\nimport org.springframework.core.Ordered;\r\nimport org.springframework.core.annotation.Order;\r\nimport org.springframework.security.config.Customizer;\r\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\r\nimport org.springframework.security.oauth2.jwt.JwtDecoder;\r\nimport org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration;\r\nimport org.springframework.security.web.SecurityFilterChain;\r\nimport com.nimbusds.jose.jwk.JWKSet;\r\nimport com.nimbusds.jose.jwk.RSAKey;\r\nimport com.nimbusds.jose.jwk.source.JWKSource;\r\nimport com.nimbusds.jose.proc.SecurityContext;\r\n\r\n@Configuration\r\npublic class AuthorizationServerConfiguration {\r\n\r\n  @Bean\r\n  @Order(Ordered.HIGHEST_PRECEDENCE)\r\n  public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http)\r\n      throws Exception {\r\n    OAuth2AuthorizationServerConfiguration.applyDefaultSecurity(http);\r\n\r\n    return http.formLogin(Customizer.withDefaults()).build();\r\n  }\r\n\r\n  @Bean\r\n  public JwtDecoder jwtDecoder(JWKSource&lt;SecurityContext&gt; jwkSource) {\r\n    return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource);\r\n  }\r\n\r\n  @Bean\r\n  public JWKSource&lt;SecurityContext&gt; jwkSource() throws NoSuchAlgorithmException {\r\n    RSAKey rsaKey = generateRsa();\r\n    JWKSet jwkSet = new JWKSet(rsaKey);\r\n\r\n    return (jwkSelector, securityContext) -&gt; jwkSelector.select(jwkSet);\r\n  }\r\n\r\n  private static RSAKey generateRsa() throws NoSuchAlgorithmException {\r\n    KeyPair keyPair = generateRsaKey();\r\n    RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();\r\n    RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();\r\n\r\n    \/\/ @formatter:off\r\n    return new RSAKey.Builder(publicKey)\r\n        .privateKey(privateKey)\r\n        .keyID(UUID.randomUUID().toString())\r\n        .build();\r\n    \/\/ @formatter:on\r\n  }\r\n\r\n  private static KeyPair generateRsaKey() throws NoSuchAlgorithmException {\r\n    KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\r\n    keyPairGenerator.initialize(2048);\r\n\r\n    return keyPairGenerator.generateKeyPair();\r\n  }\r\n}\r\n<\/pre>\n<p><strong>To store RegisteredClient information in the database, first, we need to define the database structure to do this.<\/strong><\/p>\n<p>By default, Spring Authorization Server provides us with database scripts to create the database structure. You can copy them in the Spring Authorization Server .jar file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22737 size-full aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/10\/store-registeredclient-to-database-in-spring-authorization-server-3.png\" alt=\"\" width=\"700\" height=\"808\" \/><\/p>\n<p>You can go to the Github of the Spring Authorization Server <a href=\"https:\/\/github.com\/spring-projects\/spring-authorization-server\/tree\/main\/oauth2-authorization-server\/src\/main\/resources\/org\/springframework\/security\/oauth2\/server\/authorization\" target=\"_blank\" rel=\"noopener\">here<\/a> to copy these files.<\/p>\n<p>I will use <a href=\"https:\/\/huongdanjava.com\/database-migration-using-flyway.html\" target=\"_blank\" rel=\"noopener\">Flyway<\/a> to manage database migration:<\/p>\n<pre class=\"lang:xml decode:true \">&lt;dependency&gt;\r\n  &lt;groupId&gt;org.flywaydb&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;flyway-core&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<p>by copying the schema files of the Spring Authorization Server into the src\/main\/resources\/db\/migration directory as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-21897 size-full aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/10\/store-registeredclient-to-database-in-spring-authorization-server-4.png\" alt=\"\" width=\"700\" height=\"577\" \/><\/p>\n<p>In the script that creates the oauth2_authorization table in the file V1__oauth2-authorization-schema.sql, there is a definition of the BLOB data type, presumably for the Oracle database:<\/p>\n<pre class=\"lang:java mark:7,9,12-13,16,19,22-23,26-27,30-31,34 decode:true\">CREATE TABLE oauth2_authorization (\r\n    id varchar(100) NOT NULL,\r\n    registered_client_id varchar(100) NOT NULL,\r\n    principal_name varchar(200) NOT NULL,\r\n    authorization_grant_type varchar(100) NOT NULL,\r\n    authorized_scopes varchar(1000) DEFAULT NULL,\r\n    attributes blob DEFAULT NULL,\r\n    state varchar(500) DEFAULT NULL,\r\n    authorization_code_value blob DEFAULT NULL,\r\n    authorization_code_issued_at timestamp DEFAULT NULL,\r\n    authorization_code_expires_at timestamp DEFAULT NULL,\r\n    authorization_code_metadata blob DEFAULT NULL,\r\n    access_token_value blob DEFAULT NULL,\r\n    access_token_issued_at timestamp DEFAULT NULL,\r\n    access_token_expires_at timestamp DEFAULT NULL,\r\n    access_token_metadata blob DEFAULT NULL,\r\n    access_token_type varchar(100) DEFAULT NULL,\r\n    access_token_scopes varchar(1000) DEFAULT NULL,\r\n    oidc_id_token_value blob DEFAULT NULL,\r\n    oidc_id_token_issued_at timestamp DEFAULT NULL,\r\n    oidc_id_token_expires_at timestamp DEFAULT NULL,\r\n    oidc_id_token_metadata blob DEFAULT NULL,\r\n    refresh_token_value blob DEFAULT NULL,\r\n    refresh_token_issued_at timestamp DEFAULT NULL,\r\n    refresh_token_expires_at timestamp DEFAULT NULL,\r\n    refresh_token_metadata blob DEFAULT NULL,\r\n    user_code_value blob DEFAULT NULL,\r\n    user_code_issued_at timestamp DEFAULT NULL,\r\n    user_code_expires_at timestamp DEFAULT NULL,\r\n    user_code_metadata blob DEFAULT NULL,\r\n    device_code_value blob DEFAULT NULL,\r\n    device_code_issued_at timestamp DEFAULT NULL,\r\n    device_code_expires_at timestamp DEFAULT NULL,\r\n    device_code_metadata blob DEFAULT NULL,\r\n    PRIMARY KEY (id)\r\n);<\/pre>\n<p>If you are using a PostgreSQL database like me, you need to change to TEXT type! Otherwise, running the database migration will fail.<\/p>\n<p>Declare the Datasource to run the database migration as follows:<\/p>\n<pre class=\"lang:java decode:true \">spring.datasource.url=jdbc:postgresql:\/\/localhost:5432\/authorization_server\r\nspring.datasource.username=khanh\r\nspring.datasource.password=1<\/pre>\n<p><strong>Now you can define RegisteredClient in the database<\/strong>, for example as follows:<\/p>\n<pre class=\"lang:java decode:true\">@Bean\r\npublic RegisteredClientRepository registeredClientRepository(JdbcTemplate jdbcTemplate) {\r\n  \/\/ @formatter:off\r\n  RegisteredClient registeredClient = RegisteredClient.withId(\"e4a295f7-0a5f-4cbc-bcd3-d870243d1b05\")\r\n      .clientId(\"huongdanjava1\")\r\n      .clientSecret(\"{noop}123\")\r\n      .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_POST)\r\n      .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS)\r\n      .build();\r\n  \/\/ @formatter:on\r\n\r\n  JdbcRegisteredClientRepository registeredClientRepository =\r\n      new JdbcRegisteredClientRepository(jdbcTemplate);\r\n  registeredClientRepository.save(registeredClient);\r\n\r\n  return registeredClientRepository;\r\n}<\/pre>\n<p>Here, I define a RegisteredClient with a grant type of client_credentials with a fixed ID so that every time I start the app, there is no duplicate record in the database. Depending on your needs, please write the corresponding code!<\/p>\n<p>We will use the JdbcRegisteredClientRepository object to store this RegisteredClient information. The parameter when initializing the JdbcRegisteredClientRepository object is the JdbcTemplate object.<\/p>\n<p>Now, if you run the application, you will see in the oauth2_registered_client table, a new record of RegisteredClient that I declared above, is inserted:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-19399 size-full aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/10\/store-registeredclient-to-database-in-spring-authorization-server-5.png\" alt=\"\" width=\"700\" height=\"157\" \/><\/p>\n<p>That&#8217;s it guys, if you now run the application and get the clientId token above, you will see the following results:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-18807 aligncenter\" src=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/10\/store-registeredclient-to-database-in-spring-authorization-server-6.png\" alt=\"\" width=\"700\" height=\"359\" \/><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18800&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Store RegisteredClient to database in Spring Authorization Server&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the previous tutorial, I showed you how to implement an Authorization Server using Spring Authorization Server, but the information about RegisteredClient in this tutorial is stored in memory. To store RegisteredClient information in the database, how will we do it? In this tutorial, I&hellip; <a href=\"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":1680,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2010],"tags":[],"class_list":["post-18800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-authorization-server-en","clearfix"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Store RegisteredClient to database in Spring Authorization Server - Huong Dan Java<\/title>\n<meta name=\"description\" content=\"In this tutorial, I will guide you all on how to s\btore RegisteredClient to database in Spring Authorization Server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Store RegisteredClient to database in Spring Authorization Server - Huong Dan Java\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I will guide you all on how to s\btore RegisteredClient to database in Spring Authorization Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html\" \/>\n<meta property=\"og:site_name\" content=\"Huong Dan Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-21T22:55:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-23T04:08:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Khanh Nguyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/KhanhNguyenJ\" \/>\n<meta name=\"twitter:site\" content=\"@KhanhNguyenJ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khanh Nguyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html\"},\"author\":{\"name\":\"Khanh Nguyen\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"headline\":\"Store RegisteredClient to database in Spring Authorization Server\",\"datePublished\":\"2021-10-21T22:55:01+00:00\",\"dateModified\":\"2023-12-23T04:08:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html\"},\"wordCount\":413,\"commentCount\":22,\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"articleSection\":[\"Spring Authorization Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html\",\"name\":\"Store RegisteredClient to database in Spring Authorization Server - Huong Dan Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"datePublished\":\"2021-10-21T22:55:01+00:00\",\"dateModified\":\"2023-12-23T04:08:22+00:00\",\"description\":\"In this tutorial, I will guide you all on how to s\\btore RegisteredClient to database in Spring Authorization Server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/10\\\/spring-boot.png\",\"width\":300,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/store-registeredclient-to-database-in-spring-authorization-server.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/huongdanjava.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Store RegisteredClient to database in Spring Authorization Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/\",\"name\":\"Huong Dan Java\",\"description\":\"Java development tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/huongdanjava.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\",\"name\":\"Khanh Nguyen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"width\":1267,\"height\":1517,\"caption\":\"Khanh Nguyen\"},\"logo\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\"},\"description\":\"I love Java and everything related to Java.\",\"sameAs\":[\"https:\\\/\\\/huongdanjava.com\",\"https:\\\/\\\/www.facebook.com\\\/nhkhanh2406\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/KhanhNguyenJ\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Store RegisteredClient to database in Spring Authorization Server - Huong Dan Java","description":"In this tutorial, I will guide you all on how to s\btore RegisteredClient to database in Spring Authorization Server.","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:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html","og_locale":"en_US","og_type":"article","og_title":"Store RegisteredClient to database in Spring Authorization Server - Huong Dan Java","og_description":"In this tutorial, I will guide you all on how to s\btore RegisteredClient to database in Spring Authorization Server.","og_url":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html","og_site_name":"Huong Dan Java","article_publisher":"https:\/\/www.facebook.com\/nhkhanh2406","article_author":"https:\/\/www.facebook.com\/nhkhanh2406","article_published_time":"2021-10-21T22:55:01+00:00","article_modified_time":"2023-12-23T04:08:22+00:00","og_image":[{"width":300,"height":300,"url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","type":"image\/png"}],"author":"Khanh Nguyen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/KhanhNguyenJ","twitter_site":"@KhanhNguyenJ","twitter_misc":{"Written by":"Khanh Nguyen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#article","isPartOf":{"@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html"},"author":{"name":"Khanh Nguyen","@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"headline":"Store RegisteredClient to database in Spring Authorization Server","datePublished":"2021-10-21T22:55:01+00:00","dateModified":"2023-12-23T04:08:22+00:00","mainEntityOfPage":{"@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html"},"wordCount":413,"commentCount":22,"publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"image":{"@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","articleSection":["Spring Authorization Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html","url":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html","name":"Store RegisteredClient to database in Spring Authorization Server - Huong Dan Java","isPartOf":{"@id":"https:\/\/huongdanjava.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage"},"image":{"@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","datePublished":"2021-10-21T22:55:01+00:00","dateModified":"2023-12-23T04:08:22+00:00","description":"In this tutorial, I will guide you all on how to s\btore RegisteredClient to database in Spring Authorization Server.","breadcrumb":{"@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#primaryimage","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/10\/spring-boot.png","width":300,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/huongdanjava.com\/store-registeredclient-to-database-in-spring-authorization-server.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/huongdanjava.com\/"},{"@type":"ListItem","position":2,"name":"Store RegisteredClient to database in Spring Authorization Server"}]},{"@type":"WebSite","@id":"https:\/\/huongdanjava.com\/#website","url":"https:\/\/huongdanjava.com\/","name":"Huong Dan Java","description":"Java development tutorials","publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/huongdanjava.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d","name":"Khanh Nguyen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","width":1267,"height":1517,"caption":"Khanh Nguyen"},"logo":{"@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg"},"description":"I love Java and everything related to Java.","sameAs":["https:\/\/huongdanjava.com","https:\/\/www.facebook.com\/nhkhanh2406","https:\/\/x.com\/https:\/\/twitter.com\/KhanhNguyenJ"]}]}},"_links":{"self":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/18800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/comments?post=18800"}],"version-history":[{"count":16,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/18800\/revisions"}],"predecessor-version":[{"id":22738,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/18800\/revisions\/22738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media\/1680"}],"wp:attachment":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media?parent=18800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/categories?post=18800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/tags?post=18800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}