{"id":26426,"date":"2024-10-27T10:52:37","date_gmt":"2024-10-27T10:52:37","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=26426"},"modified":"2024-11-26T07:43:37","modified_gmt":"2024-11-26T07:43:37","slug":"%ec%8a%a4%ed%94%84%eb%a7%81-%eb%b6%80%ed%8a%b8-%eb%b0%b1%ec%97%94%eb%93%9c-%ea%b0%9c%eb%b0%9c-%ea%b0%95%ec%a2%8c-oauth2%eb%a1%9c-%eb%a1%9c%ea%b7%b8%ec%9d%b8-%eb%a1%9c%ea%b7%b8%ec%95%84%ec%9b%83-7","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/26426\/","title":{"rendered":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30"},"content":{"rendered":"<p><body><\/p>\n<h2>\ubaa9\ucc28<\/h2>\n<ol>\n<li><a href=\"#\uc18c\uac1c\">\uc18c\uac1c<\/a><\/li>\n<li><a href=\"#\uc2a4\ud504\ub9c1-\ubd80\ud2b8-\uc18c\uac1c\">\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc18c\uac1c<\/a><\/li>\n<li><a href=\"#OAuth2-\uac1c\uc694\">OAuth2 \uac1c\uc694<\/a><\/li>\n<li><a href=\"#\ub85c\uadf8\uc778-\ub85c\uadf8\uc544\uc6c3-\uad6c\ud604\">\ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uad6c\ud604<\/a><\/li>\n<li><a href=\"#\uae00-\uc218\uc815-\uc0ad\uc81c-\uae30\ub2a5-\uad6c\ud604\">\uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5 \uad6c\ud604<\/a><\/li>\n<li><a href=\"#\uae00\uc4f4\uc774-\ud655\uc778-\ub85c\uc9c1-\ucd94\uac00\">\uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00<\/a><\/li>\n<li><a href=\"#\uacb0\ub860\">\uacb0\ub860<\/a><\/li>\n<\/ol>\n<h2 id=\"\uc18c\uac1c\">\uc18c\uac1c<\/h2>\n<p>\uc624\ub298\uc740 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubc31\uc5d4\ub4dc \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 OAuth2\ub97c \ud1b5\ud55c \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \ubc29\ubc95\uacfc \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5, \uadf8\ub9ac\uace0 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1\uc744 \ucd94\uac00\ud558\ub294 \ubc29\ubc95\uc744 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc744 \ud1b5\ud574 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\uc758 \ub2e4\uc591\ud55c \uae30\ub2a5\uc744 \ud65c\uc6a9\ud558\ub294 \ubc29\ubc95\uc744 \ubc30\uc6b8 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2 id=\"\uc2a4\ud504\ub9c1-\ubd80\ud2b8-\uc18c\uac1c\">\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc18c\uac1c<\/h2>\n<p>\uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub294 \uc2a4\ud504\ub9c1 \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uae30\ubc18\uc73c\ub85c \ud55c \uac04\ud3b8\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc744 \uc9c0\uc6d0\ud558\ub294 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \ubcf5\uc7a1\ud55c \uc124\uc815 \uc5c6\uc774 \ube60\ub974\uac8c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\uba70, \ub2e4\uc591\ud55c \ub0b4\uc7a5 \uc11c\ubc84(\uc608: Tomcat, Jetty \ub4f1)\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \uc2a4\ud504\ub9c1 \ubd80\ud2b8\uc758 \uc8fc\uc694 \uc774\uc810\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li>\ube60\ub978 \uc2dc\uc791: \ucd08\uae30 \uc124\uc815\uc774 \uac04\ud3b8\ud558\uc5ec \uac1c\ubc1c \uc2dc\uac04\uc744 \ub2e8\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\uc790\ub3d9 \uad6c\uc131: \ud544\uc694\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\uc640 \uc758\uc874\uc131\uc744 \uc790\ub3d9\uc73c\ub85c \uc124\uc815\ud574\uc90d\ub2c8\ub2e4.<\/li>\n<li>\ub0b4\uc7a5 \uc11c\ubc84: \ubcc4\ub3c4\uc758 \uc11c\ubc84 \uc124\uc815 \uc5c6\uc774 \ub85c\uceec\uc5d0\uc11c \uc27d\uac8c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\uac15\ub825\ud55c \ucee4\ubba4\ub2c8\ud2f0: \ud65c\ubc1c\ud55c \uc0ac\uc6a9\uc790\uc640 \ud48d\ubd80\ud55c \uc790\ub8cc\uac00 \ub9ce\uc544 \ud559\uc2b5\uacfc \ubb38\uc81c \ud574\uacb0\uc5d0 \ub3c4\uc6c0\uc774 \ub429\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2 id=\"OAuth2-\uac1c\uc694\">OAuth2 \uac1c\uc694<\/h2>\n<p>OAuth2\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc0ac\uc6a9\uc790 \uc790\uc6d0\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\ub3c4\ub85d \uad8c\ud55c\uc744 \ubd80\uc5ec\ud558\ub294 \uc778\uc99d \ud504\ub85c\ud1a0\ucf5c\uc785\ub2c8\ub2e4. OAuth2\ub97c \ud1b5\ud574 \uc0ac\uc6a9\uc790\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \ub300\ud55c \uc811\uadfc \uad8c\ud55c\uc744 \uc548\uc804\ud558\uac8c \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. OAuth2\ub294 \uc5ec\ub7ec \uc778\uc99d \ubc29\uc2dd(\uc608: Authorization Code, Implicit, Resource Owner Password Credentials \ub4f1)\uc744 \uc9c0\uc6d0\ud558\uba70, \uc77c\ubc18\uc801\uc73c\ub85c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc \ubaa8\ubc14\uc77c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \ub9ce\uc774 \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<\/p>\n<p>\uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 OAuth2\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc0ac\uc6a9\uc790 \uc778\uc99d\uc744 \uad6c\ud604\ud558\uace0, \uc774 \uc778\uc99d \uc815\ubcf4\ub97c \uac00\uc9c0\uace0 \uae00\uc744 \uc791\uc131, \uc218\uc815, \uc0ad\uc81c\ud558\ub294 \uae30\ub2a5\uc744 \ucd94\uac00\ud560 \uac83\uc785\ub2c8\ub2e4. \uc6b0\ub9ac\ub294 \uae30\ubcf8\uc801\uc73c\ub85c Authorization Code Grant \ubc29\uc2dd\uc744 \uc0ac\uc6a9\ud560 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<h2 id=\"\ub85c\uadf8\uc778-\ub85c\uadf8\uc544\uc6c3-\uad6c\ud604\">\ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uad6c\ud604<\/h2>\n<p>\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 OAuth2 \uae30\ubc18\uc758 \ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uae30\ub2a5\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc5d0\uc11c \uc2a4\ud504\ub9c1 \uc2dc\ud050\ub9ac\ud2f0(Spring Security)\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc778\uc99d \ubc0f \uad8c\ud55c \ubd80\uc5ec\ub97c \ucc98\ub9ac\ud560 \uac83\uc785\ub2c8\ub2e4. \ub2e4\uc74c \ub2e8\uacc4\ub85c \uc9c4\ud589\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>1. \uc758\uc874\uc131 \ucd94\uac00<\/h3>\n<p>\uc6b0\uc120, Maven pom.xml \ud30c\uc77c\uc5d0 \ud544\uc694\ud55c \uc758\uc874\uc131\uc744 \ucd94\uac00\ud574\uc57c \ud569\ub2c8\ub2e4. \ub2e4\uc74c\uc758 \uc758\uc874\uc131\uc744 \ucd94\uac00\ud558\uc138\uc694:<\/p>\n<pre><code>\n      &lt;dependency&gt;\n          &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n          &lt;artifactId&gt;spring-boot-starter-security&lt;\/artifactId&gt;\n      &lt;\/dependency&gt;\n      &lt;dependency&gt;\n          &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n          &lt;artifactId&gt;spring-boot-starter-oauth2-client&lt;\/artifactId&gt;\n      &lt;\/dependency&gt;\n      &lt;dependency&gt;\n          &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n          &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n      &lt;\/dependency&gt;\n    <\/code><\/pre>\n<h3>2. application.yml \uc124\uc815<\/h3>\n<p>\uc774\uc81c oauth2 \ud074\ub77c\uc774\uc5b8\ud2b8 \uc815\ubcf4\ub97c \uc124\uc815\ud574\uc57c \ud569\ub2c8\ub2e4. src\/main\/resources\/application.yml \ud30c\uc77c\uc5d0 \ub2e4\uc74c\uacfc \uac19\uc774 \uc124\uc815\ud558\uc138\uc694:<\/p>\n<pre><code>\n    spring:\n      security:\n        oauth2:\n          client:\n            registration:\n              google:\n                client-id: YOUR_CLIENT_ID\n                client-secret: YOUR_CLIENT_SECRET\n                scope: profile, email\n                redirect-uri: \"{baseUrl}\/login\/oauth2\/code\/{registrationId}\"\n                authorization-grant-type: authorization_code\n            provider:\n              google:\n                authorization-uri: https:\/\/accounts.google.com\/o\/oauth2\/auth\n                token-uri: https:\/\/oauth2.googleapis.com\/token\n                user-info-uri: https:\/\/www.googleapis.com\/userinfo\/v2\/me\n    <\/code><\/pre>\n<h3>3. SecurityConfig \ud074\ub798\uc2a4 \uc791\uc131<\/h3>\n<p>\uc548\uc804\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uad6c\uc131\uc744 \uc704\ud574 SecurityConfig \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774 \ud074\ub798\uc2a4\ub294 \uc2a4\ud504\ub9c1 \uc2dc\ud050\ub9ac\ud2f0\uc758 \ubcf4\uc548 \uc124\uc815\uc744 \ub2f4\ub2f9\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n    import org.springframework.context.annotation.Bean;\n    import org.springframework.context.annotation.Configuration;\n    import org.springframework.security.config.annotation.web.builders.HttpSecurity;\n    import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\n    import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\n\n    @Configuration\n    @EnableWebSecurity\n    public class SecurityConfig extends WebSecurityConfigurerAdapter {\n\n        @Override\n        protected void configure(HttpSecurity http) throws Exception {\n            http\n                .authorizeRequests()\n                    .antMatchers(\"\/\", \"\/login\", \"\/error\/**\").permitAll()\n                    .anyRequest().authenticated()\n                    .and()\n                .oauth2Login()\n                    .defaultSuccessUrl(\"\/home\", true)\n                    .failureUrl(\"\/login?error\");\n        }\n    }\n    <\/code><\/pre>\n<h3>4. \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \ucee8\ud2b8\ub864\ub7ec \uad6c\ud604<\/h3>\n<p>\uc0ac\uc6a9\uc790\uac00 \ub85c\uadf8\uc778\uc744 \uc2dc\ub3c4\ud560 \ub54c \ud638\ucd9c\ub418\ub294 HomeController \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud558\uc5ec \ub85c\uadf8\uc778 \ud6c4\uc758 \ud750\ub984\uc744 \ucc98\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n    import org.springframework.stereotype.Controller;\n    import org.springframework.web.bind.annotation.GetMapping;\n\n    @Controller\n    public class HomeController {\n\n        @GetMapping(\"\/\")\n        public String index() {\n            return \"index\"; \/\/ index.html \ud398\uc774\uc9c0\ub85c \ub9ac\ud134\n        }\n\n        @GetMapping(\"\/home\")\n        public String home() {\n            return \"home\"; \/\/ home.html \ud398\uc774\uc9c0\ub85c \ub9ac\ud134\n        }\n    }\n    <\/code><\/pre>\n<p>\uc5ec\uae30\uae4c\uc9c0 \uc785\ub825\ud558\uba74 \uae30\ubcf8 \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uae30\ub2a5\uc774 \uad6c\ud604\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uc774\uc81c \uc0ac\uc6a9\uc790\uac00 Google \uacc4\uc815\uc744 \ud1b5\ud574 \ub85c\uadf8\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2 id=\"\uae00-\uc218\uc815-\uc0ad\uc81c-\uae30\ub2a5-\uad6c\ud604\">\uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5 \uad6c\ud604<\/h2>\n<p>\uc774\uc81c \uae30\ubcf8\uc801\uc778 \ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uae30\ub2a5\uc744 \uad6c\ud604\ud588\uc73c\ub2c8, \ub2e4\uc74c\uc73c\ub85c\ub294 \uae00 \uc791\uc131, \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5\uc744 \ucd94\uac00\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>1. \uae00 \uac8c\uc2dc\ub97c \uc704\ud55c \uc5d4\ud2f0\ud2f0 \ubc0f \ub9ac\ud3ec\uc9c0\ud1a0\ub9ac \uc791\uc131<\/h3>\n<p>\uba3c\uc800, Post \uc5d4\ud2f0\ud2f0\uc640 \uc774\ub97c \uc704\ud55c JPA \ub9ac\ud3ec\uc9c0\ud1a0\ub9ac\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n    import javax.persistence.*;\n    import java.time.LocalDateTime;\n\n    @Entity\n    public class Post {\n        @Id\n        @GeneratedValue(strategy = GenerationType.IDENTITY)\n        private Long id;\n        \n        private String title;\n        private String content;\n\n        @ManyToOne\n        @JoinColumn(name=\"user_id\")\n        private User user; \/\/ \uc791\uc131\uc790 \uc815\ubcf4\n\n        private LocalDateTime createdAt;\n        private LocalDateTime updatedAt;\n\n        \/\/ getters and setters\n    }\n    <\/code><\/pre>\n<pre><code>\n    import org.springframework.data.jpa.repository.JpaRepository;\n\n    public interface PostRepository extends JpaRepository<post, long=\"\"> {\n    }\n    <\/post,><\/code><\/pre>\n<h3>2. \uae00 \uc791\uc131 \ubc0f \uc218\uc815 \uae30\ub2a5 \uad6c\ud604<\/h3>\n<p>\ucee8\ud2b8\ub864\ub7ec\ub97c \uc791\uc131\ud558\uc5ec \uae00 \uc791\uc131 \ubc0f \uc218\uc815 \uae30\ub2a5\uc744 \ucc98\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n    import org.springframework.security.core.annotation.AuthenticationPrincipal;\n    import org.springframework.stereotype.Controller;\n    import org.springframework.ui.Model;\n    import org.springframework.web.bind.annotation.*;\n\n    @Controller\n    @RequestMapping(\"\/posts\")\n    public class PostController {\n\n        private final PostRepository postRepository;\n\n        public PostController(PostRepository postRepository) {\n            this.postRepository = postRepository;\n        }\n\n        @GetMapping(\"\/new\")\n        public String newPost(Model model) {\n            model.addAttribute(\"post\", new Post());\n            return \"newpost\"; \/\/ \uae00 \uc791\uc131 \ud398\uc774\uc9c0\n        }\n\n        @PostMapping\n        public String createPost(@ModelAttribute Post post, @AuthenticationPrincipal User user) {\n            post.setUser(user); \/\/ \ud604\uc7ac \ub85c\uadf8\uc778\ud55c \uc0ac\uc6a9\uc790 \uc124\uc815\n            post.setCreatedAt(LocalDateTime.now());\n            postRepository.save(post);\n            return \"redirect:\/posts\";\n        }\n\n        @GetMapping(\"\/{id}\/edit\")\n        public String editPost(@PathVariable Long id, Model model) {\n            Post post = postRepository.findById(id).orElseThrow();\n            model.addAttribute(\"post\", post);\n            return \"editpost\"; \/\/ \uae00 \uc218\uc815 \ud398\uc774\uc9c0\n        }\n\n        @PostMapping(\"\/{id}\")\n        public String updatePost(@PathVariable Long id, @ModelAttribute Post post) {\n            post.setId(id);\n            post.setUpdatedAt(LocalDateTime.now());\n            postRepository.save(post);\n            return \"redirect:\/posts\";\n        }\n    }\n    <\/code><\/pre>\n<h3>3. \uae00 \uc0ad\uc81c \uae30\ub2a5 \uad6c\ud604<\/h3>\n<p>\uae00 \uc0ad\uc81c\ub97c \uc704\ud55c \uba54\uc18c\ub4dc\ub3c4 PostController\uc5d0 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n    @DeleteMapping(\"\/{id}\")\n    public String deletePost(@PathVariable Long id) {\n        postRepository.deleteById(id);\n        return \"redirect:\/posts\";\n    }\n    <\/code><\/pre>\n<h2 id=\"\uae00\uc4f4\uc774-\ud655\uc778-\ub85c\uc9c1-\ucd94\uac00\">\uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00<\/h2>\n<p>\ub9c8\uc9c0\ub9c9\uc73c\ub85c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1\uc744 \ucd94\uac00\ud558\uc5ec \uc0ac\uc6a9\uc790\uac00 \uc790\uc2e0\uc774 \uc791\uc131\ud55c \uae00\ub9cc \uc218\uc815 \ub610\ub294 \uc0ad\uc81c\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uc815\ud569\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 \uc0ac\uc6a9\uc790\uac00 \ub85c\uadf8\uc778\ud588\uc744 \ub54c, \ud574\ub2f9 \uc0ac\uc6a9\uc790\uc758 \uc815\ubcf4\uc640 \uae00\uc758 \uc791\uc131\uc790\ub97c \ube44\uad50\ud558\ub294 \ub85c\uc9c1\uc744 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n    @PostMapping(\"\/{id}\/edit\")\n    public String editPost(@PathVariable Long id, @AuthenticationPrincipal User user) {\n        Post post = postRepository.findById(id).orElseThrow();\n        if (!post.getUser().equals(user)) {\n            throw new AccessDeniedException(\"\uc774 \uae00\uc740 \uc218\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\"); \/\/ \uc811\uadfc \uac70\ubd80 \uc608\uc678\n        }\n        return \"editpost\"; \/\/ \uc218\uc815 \ud398\uc774\uc9c0\ub85c \uc774\ub3d9\n    }\n\n    @DeleteMapping(\"\/{id}\")\n    public String deletePost(@PathVariable Long id, @AuthenticationPrincipal User user) {\n        Post post = postRepository.findById(id).orElseThrow();\n        if (!post.getUser().equals(user)) {\n            throw new AccessDeniedException(\"\uc774 \uae00\uc740 \uc0ad\uc81c\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\"); \/\/ \uc811\uadfc \uac70\ubd80 \uc608\uc678\n        }\n        postRepository.deleteById(id);\n        return \"redirect:\/posts\";\n    }\n    <\/code><\/pre>\n<h2 id=\"\uacb0\ub860\">\uacb0\ub860<\/h2>\n<p>\uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec OAuth2 \uae30\ubc18\uc758 \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uae30\ub2a5\uc744 \uad6c\ud604\ud558\uace0, \uae00 \uc791\uc131, \uc218\uc815, \uc0ad\uc81c \uae30\ub2a5\uc744 \ucd94\uac00\ud558\ub294 \ubc29\ubc95\uc744 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4. \ub610\ud55c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1\uc744 \ud1b5\ud574 \uc0ac\uc6a9\uc790\uac00 \uc790\uc2e0\uc758 \uae00\ub9cc \uc218\uc815 \ub610\ub294 \uc0ad\uc81c\ud560 \uc218 \uc788\ub3c4\ub85d \ud558\ub294 \uc548\uc804 \uc7a5\uce58\ub97c \ub9c8\ub828\ud588\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uacfc\uc815\uc744 \ud1b5\ud574 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\uc640 OAuth2\uc758 \uae30\ubcf8\uc801\uc778 \uc0ac\uc6a9\ubc95\uc744 \uc775\ud790 \uc218 \uc788\uc5c8\uc73c\uba70, \uc2e4\uc81c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \ud544\uc694\ud55c \uae30\ucd08 \uc9c0\uc2dd\uc744 \uc313\uc744 \uc218 \uc788\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc55e\uc73c\ub85c\ub3c4 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \ud65c\uc6a9\ud55c \ub2e4\uc591\ud55c \uae30\ub2a5\uc5d0 \ub300\ud574 \ud559\uc2b5\ud558\uba70, \ub354 \ub098\uc544\uac00 \uc2e4\ub825\uc774 \ud5a5\uc0c1\ub418\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. \uc5ec\ub7ec\ubd84\uc758 \uac1c\ubc1c \uc5ec\uc815\uc5d0 \ud589\uc6b4\uc744 \ube55\ub2c8\ub2e4!<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubaa9\ucc28 \uc18c\uac1c \uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc18c\uac1c OAuth2 \uac1c\uc694 \ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5 \uad6c\ud604 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00 \uacb0\ub860 \uc18c\uac1c \uc624\ub298\uc740 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubc31\uc5d4\ub4dc \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 OAuth2\ub97c \ud1b5\ud55c \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \ubc29\ubc95\uacfc \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5, \uadf8\ub9ac\uace0 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1\uc744 \ucd94\uac00\ud558\ub294 \ubc29\ubc95\uc744 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc744 \ud1b5\ud574 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/26426\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-26426","post","type-post","status-publish","format-standard","hentry","category-21"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/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:\/\/atmokpo.com\/w\/26426\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ubaa9\ucc28 \uc18c\uac1c \uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc18c\uac1c OAuth2 \uac1c\uc694 \ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5 \uad6c\ud604 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00 \uacb0\ub860 \uc18c\uac1c \uc624\ub298\uc740 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubc31\uc5d4\ub4dc \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 OAuth2\ub97c \ud1b5\ud55c \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \ubc29\ubc95\uacfc \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5, \uadf8\ub9ac\uace0 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1\uc744 \ucd94\uac00\ud558\ub294 \ubc29\ubc95\uc744 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc744 \ud1b5\ud574 &hellip; \ub354 \ubcf4\uae30 &quot;\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/26426\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-27T10:52:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T07:43:37+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/26426\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/26426\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30\",\"datePublished\":\"2024-10-27T10:52:37+00:00\",\"dateModified\":\"2024-11-26T07:43:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/26426\/\"},\"wordCount\":43,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/26426\/\",\"url\":\"https:\/\/atmokpo.com\/w\/26426\/\",\"name\":\"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-10-27T10:52:37+00:00\",\"dateModified\":\"2024-11-26T07:43:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/26426\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/26426\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/26426\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","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:\/\/atmokpo.com\/w\/26426\/","og_locale":"ko_KR","og_type":"article","og_title":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ubaa9\ucc28 \uc18c\uac1c \uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc18c\uac1c OAuth2 \uac1c\uc694 \ub85c\uadf8\uc778\/\ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5 \uad6c\ud604 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00 \uacb0\ub860 \uc18c\uac1c \uc624\ub298\uc740 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubc31\uc5d4\ub4dc \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774\ubc88 \uac15\uc88c\uc5d0\uc11c\ub294 OAuth2\ub97c \ud1b5\ud55c \ub85c\uadf8\uc778 \ubc0f \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604 \ubc29\ubc95\uacfc \uae00 \uc218\uc815 \ubc0f \uc0ad\uc81c \uae30\ub2a5, \uadf8\ub9ac\uace0 \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1\uc744 \ucd94\uac00\ud558\ub294 \ubc29\ubc95\uc744 \ub2e4\ub8f0 \uac83\uc785\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc744 \ud1b5\ud574 &hellip; \ub354 \ubcf4\uae30 \"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30\"","og_url":"https:\/\/atmokpo.com\/w\/26426\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-10-27T10:52:37+00:00","article_modified_time":"2024-11-26T07:43:37+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/26426\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/26426\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30","datePublished":"2024-10-27T10:52:37+00:00","dateModified":"2024-11-26T07:43:37+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/26426\/"},"wordCount":43,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/26426\/","url":"https:\/\/atmokpo.com\/w\/26426\/","name":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-10-27T10:52:37+00:00","dateModified":"2024-11-26T07:43:37+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/26426\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/26426\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/26426\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uae00 \uc218\uc815, \uc0ad\uc81c, \uae00\uc4f4\uc774 \ud655\uc778 \ub85c\uc9c1 \ucd94\uac00\ud558\uae30"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":26432,"url":"https:\/\/atmokpo.com\/w\/26432\/","url_meta":{"origin":26426,"position":0},"title":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, OAuth2\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3 \uad6c\ud604, \uc758\uc874\uc131 \ucd94\uac00\ud558\uae30","author":"root","date":"2024\ub144 10\uc6d4 27\uc77c","format":false,"excerpt":"\uc800\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: [\ud604\uc7ac \ub0a0\uc9dc] 1. \uc11c\ub860 \ud604\ub300 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc740 \uc0ac\uc6a9\uc790 \uc778\uc99d\uacfc \uad8c\ud55c \ubd80\uc5ec\ub97c \uc704\ud574 OAuth2 \ud504\ub85c\ud1a0\ucf5c\uc744 \ub9ce\uc774 \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc774 \ud504\ub85c\ud1a0\ucf5c\uc740 \ub2e4\uc591\ud55c \ud074\ub77c\uc774\uc5b8\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc548\uc804\ud558\uace0 \uc720\uc5f0\ud55c \ubc29\uc2dd\uc73c\ub85c \uc0ac\uc6a9\uc790 \uc815\ubcf4\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec OAuth2\ub97c \uae30\ubc18\uc73c\ub85c \ud55c \ub85c\uadf8\uc778\uacfc \ub85c\uadf8\uc544\uc6c3 \uae30\ub2a5\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc548\ub0b4\ud569\ub2c8\ub2e4. 2. \uc2a4\ud504\ub9c1 \ubd80\ud2b8\u2026","rel":"","context":"&quot;\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c&quot;\uc5d0\uc11c","block_context":{"text":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c","link":"https:\/\/atmokpo.com\/w\/category\/%ec%8a%a4%ed%94%84%eb%a7%81-%eb%b6%80%ed%8a%b8-%eb%b0%b1%ec%95%a4%eb%93%9c-%ea%b0%9c%eb%b0%9c-%ea%b0%95%ec%a2%8c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26620,"url":"https:\/\/atmokpo.com\/w\/26620\/","url_meta":{"origin":26426,"position":1},"title":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, \uc2a4\ud504\ub9c1 \uc2dc\ud050\ub9ac\ud2f0\ub85c \ub85c\uadf8\uc778 \ub85c\uadf8\uc544\uc6c3, \ud68c\uc6d0 \uac00\uc785 \uad6c\ud604, \uc758\uc874\uc131 \ucd94\uac00\ud558\uae30","author":"root","date":"2024\ub144 10\uc6d4 27\uc77c","format":false,"excerpt":"\ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub97c \uc774\uc6a9\ud55c \ubc31\uc5d4\ub4dc \uac1c\ubc1c\uc5d0 \uad00\ud55c \uae30\ubcf8\uc801\uc778 \ub0b4\uc6a9\uc744 \ub2e4\ub8e8\uace0, \uc2a4\ud504\ub9c1 \uc2dc\ud050\ub9ac\ud2f0\ub97c \ud1b5\ud574 \ub85c\uadf8\uc778, \ub85c\uadf8\uc544\uc6c3, \ud68c\uc6d0 \uac00\uc785 \uae30\ub2a5\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc124\uba85\ud569\ub2c8\ub2e4. 1. \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub780? \uc2a4\ud504\ub9c1 \ubd80\ud2b8(Spring Boot)\ub294 \uc2a4\ud504\ub9c1 \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uae30\ubc18\uc73c\ub85c \ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc2a4\ud504\ub9c1 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub354\uc6b1 \uc27d\uac8c \uc124\uc815\ud558\uace0 \uc2e4\ud589\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. \ubcf5\uc7a1\ud55c \uc124\uc815 \uacfc\uc815\uc744 \ucd5c\uc18c\ud654\ud558\uace0, \ub0b4\uc7a5\ud615 \uc11c\ubc84\ub97c\u2026","rel":"","context":"&quot;\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c&quot;\uc5d0\uc11c","block_context":{"text":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c","link":"https:\/\/atmokpo.com\/w\/category\/%ec%8a%a4%ed%94%84%eb%a7%81-%eb%b6%80%ed%8a%b8-%eb%b0%b1%ec%95%a4%eb%93%9c-%ea%b0%9c%eb%b0%9c-%ea%b0%95%ec%a2%8c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26670,"url":"https:\/\/atmokpo.com\/w\/26670\/","url_meta":{"origin":26426,"position":2},"title":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc5d4\ub4dc \uac1c\ubc1c \uac15\uc88c, \uc81c\uc5b4\uc758 \uc5ed\uc804\uacfc \uc758\uc874\uc131 \uc8fc\uc785","author":"root","date":"2024\ub144 10\uc6d4 27\uc77c","format":false,"excerpt":"\uc791\uc131\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c 1. \uc11c\ub860 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\ub294 \uc790\ubc14 \uae30\ubc18\uc758 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc744 \uc2e0\uc18d\ud558\uac8c \ud560 \uc218 \uc788\ub3c4\ub85d \ub3d5\ub294 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uc774 \uac15\uc88c\uc5d0\uc11c\ub294 \uc2a4\ud504\ub9c1 \ubd80\ud2b8\uc758 \ud575\uc2ec \uac1c\ub150 \uc911 \ud558\ub098\uc778 \uc81c\uc5b4\uc758 \uc5ed\uc804(Inversion of Control, IoC)\uacfc \uc758\uc874\uc131 \uc8fc\uc785(Dependency Injection, DI)\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \ub450 \uac00\uc9c0 \uac1c\ub150\uc740 \uc2a4\ud504\ub9c1 \ubd80\ud2b8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uad6c\uc870\ub97c \uc5b4\ub5bb\uac8c \uc124\uacc4\ud558\uace0\u2026","rel":"","context":"&quot;\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c&quot;\uc5d0\uc11c","block_context":{"text":"\uc2a4\ud504\ub9c1 \ubd80\ud2b8 \ubc31\uc564\ub4dc \uac1c\ubc1c \uac15\uc88c","link":"https:\/\/atmokpo.com\/w\/category\/%ec%8a%a4%ed%94%84%eb%a7%81-%eb%b6%80%ed%8a%b8-%eb%b0%b1%ec%95%a4%eb%93%9c-%ea%b0%9c%eb%b0%9c-%ea%b0%95%ec%a2%8c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":38402,"url":"https:\/\/atmokpo.com\/w\/38402\/","url_meta":{"origin":26426,"position":3},"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc561\uc138\uc2a4 \ud1a0\ud070 \uc0dd\uc131\uacfc \uac80\uc99d","author":"root","date":"2024\ub144 11\uc6d4 01\uc77c","format":false,"excerpt":"\uc791\uc131\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c 1. \uc11c\ub860 FastAPI\ub294 Python\uc744 \uae30\ubc18\uc73c\ub85c \ud558\ub294 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uba70 \ucd5c\uc801\ud654\ub41c \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4. RESTful API\ub97c \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \ub3d5\ub294 FastAPI\uc758 \ud2b9\uc9d5 \uc911 \ud558\ub098\ub294 \ub370\uc774\ud130 \uac80\uc99d\uacfc \uc790\ub3d9 \ubb38\uc11c \uc0dd\uc131 \uae30\ub2a5\uc785\ub2c8\ub2e4. \uc774 \uac15\uc88c\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc561\uc138\uc2a4 \ud1a0\ud070\uc744 \uc0dd\uc131\ud558\uace0 \uac80\uc99d\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \ub2e4\ub8f9\ub2c8\ub2e4. \uc561\uc138\uc2a4\u2026","rel":"","context":"&quot;FastAPI\uc11c\ubc84\uac1c\ubc1c&quot;\uc5d0\uc11c","block_context":{"text":"FastAPI\uc11c\ubc84\uac1c\ubc1c","link":"https:\/\/atmokpo.com\/w\/category\/fastapi%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25580,"url":"https:\/\/atmokpo.com\/w\/25580\/","url_meta":{"origin":26426,"position":4},"title":"\ud50c\ub7ec\ud130 \uac15\uc88c: 16.1 \ud30c\uc774\uc5b4\ubca0\uc774\uc2a4 \uc18c\uac1c","author":"root","date":"2024\ub144 10\uc6d4 26\uc77c","format":false,"excerpt":"\uc791\uc131\uc790: \uc870\uad11\ud615 \uc791\uc131\uc77c: 2024\ub144 11\uc6d4 26\uc77c \ubaa9\ucc28 1. \ud30c\uc774\uc5b4\ubca0\uc774\uc2a4\ub780? 2. \ud30c\uc774\uc5b4\ubca0\uc774\uc2a4\uc758 \uc8fc\uc694 \uae30\ub2a5 3. \ud50c\ub7ec\ud130 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \ud30c\uc774\uc5b4\ubca0\uc774\uc2a4 \uc124\uc815\ud558\uae30 4. Firestore \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud0d0\uc0c9 5. \uc0ac\uc6a9\uc790 \uc778\uc99d 6. \ud478\uc2dc \uc54c\ub9bc 7. \uc790\uc8fc \ubc1c\uc0dd\ud558\ub294 \ubb38\uc81c \ubc0f \ud574\uacb0\ubc95 8. \uacb0\ub860 1. \ud30c\uc774\uc5b4\ubca0\uc774\uc2a4\ub780? \ud30c\uc774\uc5b4\ubca0\uc774\uc2a4(Firebase)\ub294 \uad6c\uae00\uc774 \uc81c\uacf5\ud558\ub294 \ubaa8\ubc14\uc77c \ubc0f \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c \ud50c\ub7ab\ud3fc\uc785\ub2c8\ub2e4. \uc774 \ud50c\ub7ab\ud3fc\uc740 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758\u2026","rel":"","context":"&quot;\ud50c\ub7ec\ud130 \uac15\uc88c&quot;\uc5d0\uc11c","block_context":{"text":"\ud50c\ub7ec\ud130 \uac15\uc88c","link":"https:\/\/atmokpo.com\/w\/category\/%ed%94%8c%eb%9f%ac%ed%84%b0-%ea%b0%95%ec%a2%8c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":43394,"url":"https:\/\/atmokpo.com\/w\/43394\/","url_meta":{"origin":26426,"position":5},"title":"[\uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14]  \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14 \uac1c\ubc1c\uc5d0\uc11c\uc758 \ubcf4\uc548 \uad00\ub828 \uace0\ub824\uc0ac\ud56d","author":"root","date":"2024\ub144 11\uc6d4 27\uc77c","format":false,"excerpt":"\uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14\ub294 \ud06c\ub85c\uc2a4 \ud50c\ub7ab\ud3fc \ubaa8\ubc14\uc77c \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8 \uac1c\ubc1c\uc744 \uc704\ud55c \uc720\uc6a9\ud55c \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \ubaa8\ub4e0 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uac1c\ubc1c\uc5d0\uc11c\uc640 \ub9c8\ucc2c\uac00\uc9c0\ub85c, \ubcf4\uc548\uc740 \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14\uc5d0\uc11c\ub3c4 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c\uc785\ub2c8\ub2e4. \ubaa8\ubc14\uc77c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc740 \uc0ac\uc6a9\uc790 \ub370\uc774\ud130, \uac1c\uc778\uc815\ubcf4, \uacb0\uc81c \uc815\ubcf4 \ub4f1\uc744 \ub2e4\ub8e8\uae30 \ub54c\ubb38\uc5d0 \uac15\ub825\ud55c \ubcf4\uc548 \uc870\uce58\uac00 \uc694\uad6c\ub429\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud560 \ub54c \uace0\ub824\ud574\uc57c \ud560 \ubcf4\uc548 \uad00\ub828 \uc0ac\ud56d\ub4e4\uc744 \uc138\ubd80\uc801\uc73c\ub85c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\u2026","rel":"","context":"&quot;cordova&quot;\uc5d0\uc11c","block_context":{"text":"cordova","link":"https:\/\/atmokpo.com\/w\/category\/cordova\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/26426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=26426"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/26426\/revisions"}],"predecessor-version":[{"id":26427,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/26426\/revisions\/26427"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=26426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=26426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=26426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}