๋ฐ์ํ Spring Boot21 [error] Unable to determine Dialect without JDBC metadata ํด๊ฒฐ SpringBoot๋ mariaDB(ํน์ mySQL) ์ฐ๋์ด ์๋์ ๋ ๋ฐ์ํ๋ ์๋ฌ์ธ๋ฏ. application.properties๋ application.yml ํ์ผ ๊ฐ์์คํ๋ ๋ญ ๋นผ๋จน์๊ฑฐ ์๋ ๋ณด์ธ์ ์ ์ ๊ฒฝ์ฐ๋ ํ๊ฒฝ๋ณ์ ๋ฑ๋กํด๋์ .env ํ์ผ ์ธ์์ด ์๋ผ์ ์๋ฌ๋ ๊ฐ์. ๊ทผ๋ฐ ๋งค๋ฒ ํ๋ก์ ํธ ๊ป๋ค ํฌ๋๋ง๋ค edit Configuration๋ค์ด๊ฐ์ .envํ์ผ ๋ฑ๋กํด์ค์ผ ํ๋๊ฑด๊ฐ..? ํ 2025. 11. 28. [JUnit] does not declare any static, non-private, non-final, nested classes annotated with @Configuration ์๋ฌ ํด๊ฒฐ JUnit ํ ์คํธ ์ฝ๋ ๋๋ฆฌ๋ค๊ฐ does not declare any static, non-private, non-final, nested classes annotated with @Configuration.๋ผ๊ณ ์๋ฌ๊ฐ ๋์ค๋ฉด์ ์คํ์ด ์๋จ @SpringBootTest ์๋์@ContextConfiguration(classes = SpringBootApplication.class) ๋ถ์ฌ์ ํด๊ฒฐํจ ๊ธฐ์กด์๋ ๋ณ๋๋ก ์ด๋ค ์ค์ ํด๋์ค๋ฅผ ์ธ์ง ๋ช ์๋ฅผ ์ํด๋์ ์คํ๋ง์ด ์ฐพ์ผ๋ ค๊ณ ์๋ํ๋ ค๋ค๊ฐ ๋ชป์ฐพ์๊ฑฐ์. ๊ทผ๋ฐ @ContextConfiguration(classes = BlogApplication.class) ๋ผ๊ณ ์จ์ค์ผ๋ก์จ์ง์ ๋ช ์๋ก ๋ฎ์ด์ค๊ฒ. 2025. 5. 28. [OAuth] OAuth2 ์ค์ ํ์ผ ์์ฑ OAuth2๋ฅผ ๊ธฐ์กด JWT์ ํจ๊ป ์ฐ๋ ค๋ฉด๊ธฐ์กด์ ์์ฑํด๋ ์ค์ ์ด ์๋๋ผ ๋ค๋ฅธ ์ค์ ์ ์จ์ผํจ. 1. ๊ธฐ์กด ํผ ๋ก๊ทธ์ธ ๋ฐฉ์์ ์ป๋ WebSecurityConfig.java ํ์ผ ์ ๋ถ ์ฃผ์์ฒ๋ฆฌ~~~~~ 2 . config ํจํค์ง์ WebOauthSecurityConfig.java ์์ฑ@RequiredArgsConstructor@Configurationpublic class WebOAuthSecurityConfig { private final OAuth2UserCustomService oAuth2UserCustomService; private final TokenProvider tokenProvider; private final RefreshTokenService refreshTokenSer.. 2025. 5. 11. [OAuth2] OAuth2 ์ฌ์ฉ์ ์๋น์ค ๊ตฌํํ๊ธฐ ์ฌ์ฉ์ ์ ๋ณด๋ฅผ ์กฐํํด์, ์ ์ ํ ์ด๋ธ์ ์ ๋ณด๊ฐ ์๋ ์ฌ์ฉ์๋ผ๋ฉด๋ฆฌ์์ค ์๋ฒ์์ ์ ๊ณตํด์ฃผ๋ ์ด๋ฆ์ ์ ๋ํด์ค. ์ ์ ํ ์ด๋ธ์ ์ ๋ณด๊ฐ ์๋ ์ฌ์ฉ์๋ผ๋ฉด์ ์ฌ์ฉ์๋ฅผ ์์ฑํด์ DB์ ์ ์ฅ @Table(name = "users")@NoArgsConstructor(access = AccessLevel.PROTECTED)@Getter@Entitypublic class User implements UserDetails { // ์๋ต // ๋๋ค์ ํ๋ ์ถ๊ฐ @Column(name = "nickname", unique = true) private String nickname; // ๋น๋ ํจํด์ ๋๋ค์ ์ถ๊ฐ @Builder public User(String email, String .. 2025. 5. 11. [OAuth] OAuth ์์กด์ฑ ์ถ๊ฐ, ์ฟ ํค ๊ด๋ฆฌ ํด๋์ค ๊ตฌํํ๊ธฐ ์ฐ์ ์ง๋๋ฒ์ ๋ฐ์๋๊ตฌ๊ธ ํด๋ผ์ด์ธํธID๋ ์ํฌ๋ฆฟํค, DB ์ค์ ๋น๋ฒ ๋ชจ๋.env ํ์ผ๋ก ๋นผ๋๊ณ gitignore์ ์ค์ ๊น์ง ํด๋ . ์ด์ ์ฟ ํค ๊ด๋ฆฌ ํด๋์ค ๊ตฌํํ๊ณ ,OAuth์์ ์ ๊ณต๋ฐ์ ์ฌ์ฉ์ ์ ๋ณด ๊ฐ์ ธ์ค๋ ์ญํ ํ๋ ์๋น์ค ๋ง๋ค๊ฒ ใ ใ build.gradle์ oauth2-client ์์กด์ฑ ์ถ๊ฐ implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' ์ฟ ํค ๊ด๋ฆฌ ํด๋์ค ๊ตฌํํ๊ธฐ public class CookieUtil { // ์์ฒญ๊ฐ(์ด๋ฆ, ๊ฐ, ๋ง๋ฃ ๊ธฐ๊ฐ)์ ๋ฐํ์ผ๋ก ์ฟ ํค ์ถ๊ฐํ๋ ๋ฉ์๋ public static void addCookie(HttpServletResponse response, Stri.. 2025. 5. 8. [OAuth] ๊ตฌ๊ธ ๋ก๊ทธ์ธ ๊ธฐ๋ฅ1 ( ํ ํฐ ๋ฐ๊ธ๋ฐ๊ธฐ) ๊ตฌ๊ธ ๋ก๊ทธ์ธ ๊ธฐ๋ฅ ํ๋ ค๋ฉด, ์ธ์ฆ์๋ฒ์๊ฒ ํ ํฐ ์ ๊ณต ๋ฐ์์ผ๋จ. 1. ๊ตฌ๊ธ ํด๋ผ์ฐ๋ ์ฝ์ ๋ค์ด๊ฐ์https://cloud.google.com/cloud-console https://cloud.google.com/cloud-console cloud.google.com [์ฝ์] ๋ฒํผ ํด๋ฆญ. (์ต์ด๋ฉด ์ฌ์ฉ ๋์ ํ๋ฉด ๋ฐ๊ฑฐ์. ๋์ํ๊ณ ์ ์ฐจ ๋ง์น๋ฉด ๋จ) 2. ์ผ์ชฝ ์์ [ํ๋ก์ ํธ ์ ํ] ํด๋ฆญ, 2-1. [์ ํ๋ก์ ํธ] ๋ฒํผ ํด๋ฆญ 3. ํ๋ก์ ํธ ์ด๋ฆ, ์กฐ์ง ์์์ ์ ์ค์ ํ๊ณ [๋ง๋ค๊ธฐ] ๋ฒํผ ํด๋ฆญ 4. ์ค๋ฅธ์ชฝ ์ ์๋ฆผ(์ข ๋ชจ์)์ ๋ณด๋ฉด ํ๋ก์ ํธ๊ฐ ๋ณด์๊ทธ๊ฑฐ ํด๋ฆญ 5. [API ๋ฐ ์๋น์ค] - [์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด] ํด๋ฆญ 6. ์ค๋ฅธ์ชฝ ์๋จ์ [๋์ ํ๋ฉด ๊ตฌ์ฑ] ํด๋ฆญ 7. ์ฑ ์์๋ User Ty.. 2025. 5. 7. [Spring Boot] ์ฟ ํค๋? Cookie ๐ช ์ฟ ํค๋? ์ฟ ํค๋, ์ฌ์ฉ์๊ฐ ์ด๋ค ์ฌ์ดํธ ๋ฐฉ๋ฌธ ํ์ ๋,ํด๋น ์ฌ์ดํธ ์๋ฒ์์ ๋ด ๋ก์ปฌ ํ๊ฒฝ์ ์ ์ฅํ๋ ์์ ๋ฐ์ดํฐ์.ํด๋ผ์ด์ธํธ(๋ธ๋ผ์ฐ์ )์ ์ ์ฅ๋จ. ์ด ์ฟ ํค ๋๋ถ์, ์์ ์ ๋ฐฉ๋ฌธํ ์ ์๋์ง ์๋์ง ์ ์ ์๊ณ ์ด์ ์ ๋ก๊ทธ์ธํ๋ ์ด๋ ฅ์ด ์์ผ๋ฉด ๋ก๊ทธ์ธ ์ ๋ณด๋ ์ ์งํ ์ ์๋๊ฑฐ์. ์ฟ ํค๋ ํค-๊ฐ ์ผ๋ก ์ด๋ฃจ์ด์ ธ ์์.๋ง๋ฃ๊ธฐ๊ฐ, ๋๋ฉ์ธ ๋ฑ ์ ๋ณด ๊ฐ๊ณ ์์exsessionIdaccess_token(JWT ์์ธ์ค ํ ํฐ)theme = darkcartId = xyz123์ด๋ฐ์ ๋ค... ์ค์ ๋ก๋ HTTP ์์ฒญ ํค๋์ ํฌํจ๋์ด ์๋ฒ๋ก ๊ฐ. HTTP ์์ฒญ ํตํด์ ์ฟ ํค์ ํน์ ํค์ ๊ฐ ์ถ๊ฐ ๊ฐ๋ฅ. ํด๋ผ์ด์ธํธ๊ฐ ์๋ฒ๋ก ์ ๋ณด ์์ฒญํ๋ฉด,์๋ฒ์์ ๊ทธ ์ ๋ณด๋ฅผ ๊ฐ์ผ๋ก ๋ฃ์ ์ฟ ํค๋ฅผ ๋ง๋ฆ.๊ทธ๋ฌ๊ณ HTTP ํค๋์ ํจ๊ป ๋๋ ค๋ณด๋.(Set-Coo.. 2025. 5. 7. [OAuth] OAuth๋? ํ๋ฆ, ์ฉ์ด ์ ๋ฆฌ OAuth๊ฐ ๋ญ๊น?OAuth๋ ์ 3์ ์๋น์ค์ ๊ณ์ ๊ด๋ฆฌ๋ฅผ ๋งก๊ธฐ๋ ๋ฐฉ์์.ex) ์นด์นด์ค๋ก ๋ก๊ทธ์ธํ๊ธฐ, ๋ค์ด๋ฒ๋ก ๋ก๊ทธ์ธํ๊ธฐ ๋ฑ๋ฑ.. OAuth ์ฉ์ด ์ ๋ฆฌ๋จผ์ ํ๊ฒ ์. ๋ฆฌ์์ค ์ค๋(resource owner)์ธ์ฆ ์๋ฒ์ ์์ ์ ์ ๋ณด์ฌ์ฉ์ ํ๊ฐํ๋ ์ฃผ์ฒด.์๋น์ค ์ด์ฉํ๋ ์ฌ์ฉ์๊ฐ ๋ฆฌ์์ค ์ค๋์. ๋ฆฌ์์ค ์๋ฒ(resource server)๋ฆฌ์์ค ์ค๋ ์ ๋ณด๋ฅผ ๊ฐ์ง๊ณ , ์ค๋์ ์ ๋ณด๋ฅผ ๋ณดํธํ๋ ์ฃผ์ฒด.๋ค์ด๋ฒ, ์นด์นด์ค, ๊ตฌ๊ธ์ด ๋ฆฌ์์ค ์๋ฒ์. ์ธ์ฆ ์๋ฒ(Authorization server)ํด๋ผ์ด์ธํธ์๊ฒ ๋ฆฌ์์ค ์ค๋์ ์ ๋ณด์ ์ ๊ทผํ ์ ์๊ฒ ํ ํฐ ๋ฐ๊ธํ๋ ์ญํ ์ ํ๋ ์ ํ๋ฆฌ์ผ์ด์ (์ค์ ์ด์์์๋ ์นด์นด์ค๊ฐ์ ๊ธฐ๊ด์ด ๋ฆฌ์์ค ์๋ฒ, ์ธ์ฆ์๋ฒ ์ญํ ๋์์ ์ํํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง์) ํด๋ผ์ด์ธํธ ์ ํ๋ฆฌ์ผ์ด์ (Client Applica.. 2025. 5. 7. [Spring Boot] ํ์๋ฆฌํ ์์ , Model ๊ฐ์ฒด๋? @Controllerpublic class ExampleController { @GetMapping("/thymeleaf/example") public String thymeleafExample(Model model) { Person examplePerson = new Person(); examplePerson.setId(1L); examplePerson.setName("ํ๊ธธ๋"); examplePerson.setAge(18); examplePerson.setHobbies(List.of("์ด๋", "๋ ์")); model.addAttribute("person", examplePerson); model.add.. 2025. 5. 3. ์ด์ 1 2 3 ๋ค์ ๋ฐ์ํ