๐จ Projects19 [์๋ฌ๋ชจ์] The dependencies of some of the beans in the application context form a cycle ์๋ฌ ์ค๋ช ์๋ฐ ํ๋ก์ ํธ ์ค 2๊ฐ์ ํด๋์ค๊ฐ ์๋ก๋ฅผ ์ฐธ์กฐํ๋ ํํ๋ฅผ ๊ฐ์ง ๋ ์๊ธฐ๋ ์๋ฌ SecurityConfig.java @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) @RequiredArgsConstructor public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Autowired private PrincipalOauth2UserService principalOauth2UserService; // ๋ฌธ์ ๋๋ ๋ถ๋ถ @Bean public BCryptPasswordEncoder encodePwd.. 2023. 3. 18. ๋ค์ด๋ฒ ๋ก๊ทธ์ธ API Goal 1. ๋ค์ด๋ฒ ๋ก๊ทธ์ธ API ์ฌ์ฉํ๊ธฐ ๋ค์ด๋ฒ ๋ก๊ทธ์ธ API 1. https://developers.naver.com/apps/#/register ๋ค์ด๋ฒ ๋ก๊ทธ์ธ ํ๊ธฐ 2. ์ ํ๋ฆฌ์ผ์ด์ ๋ฑ๋ก (API ์ด์ฉ์ ์ฒญ) > ์นธ ์ฑ์๋ฃ๊ธฐ > ๋ฑ๋กํ๊ธฐ 3. ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ณด Client ID์ Client Secret์ application.properties์ ์ฑ์๋ฃ๊ธฐ 4. ์๋ฐ ํ๋ก์ ํธ application.properties์ ๋ค์ด๋ฒ ๋ก๊ทธ์ธ ๊ด๋ จ security ์ค์ ํ๊ธฐ # NAVER SECURITY spring.security.oauth2.client.registration.naver.client-id=ํด๋ผ์ด์ธํธID์ ๋ ฅ spring.security.oauth2.client.registration.naver.. 2023. 3. 17. Facebook ๋ก๊ทธ์ธ API Goal 1. ํ์ด์ค๋ถ ๋ก๊ทธ์ธ API ์ฌ์ฉํ๊ธฐ ํ์ด์ค๋ถ ๋ก๊ทธ์ธ API 1. https://developers.facebook.com/apps/ ์์ ํ์ด์ค๋ถ์ ๋ก๊ทธ์ธํ๊ธฐ 2. ํ์ด์ค๋ถ ๋ก๊ทธ์ธ API ์ฌ์ฉํ๊ธฐ > My Apps 3. ์ฑ ๋ง๋ค๊ธฐ 4. ์ฑ ํ์ ์ ํํ๊ธฐ > ๋ค์ 5. ์ฑ ์ด๋ฆ ์ฐ๊ธฐ > ์ฑ ๋ง๋ค๊ธฐ 6. Facebook ๋ก๊ทธ์ธ ์ค์ ํ๊ธฐ > ์น > ์ฌ์ดํธ URL์ http://localhost:8080 ์ฐ๊ธฐ > ๋ค์ > ๋ค์ > ๋ค์ > ๋์๊ฐ๊ธฐ 7. ์ค์ > ๊ธฐ๋ณธ ์ค์ > ์ฑ ID์ ์ํฌ๋ฆฟ ์ฝ๋ ํ์ธ 8. App ID์ secret์ application.properties์ ๋ณต๋ถํ๊ธฐ ## application.properties์ ํ์ด์ค๋ถ ๋ก๊ทธ์ธ API ์ค์ # SECURITY spring.se.. 2023. 3. 16. ๊ตฌ๊ธ ๋ก๊ทธ์ธ API Goal 1. ๊ตฌ๊ธ ๋ก๊ทธ์ธ API ์ฌ์ฉํ๊ธฐ ๊ตฌ๊ธ API 1. Google API Console https://console.cloud.google.com/apis/dashboard?project=able-math-371003&organizationId=0 2. ํ๋ก์ ํธ ์๋ก ๋ง๋ค๊ธฐ 3. ์๋ก ๋ง๋ ํ๋ก์ ํธ ์ ํ 4. OAuth ๋์ ํ๋ฉด > “์ธ๋ถ” ์ ํ > ๋ง๋ค๊ธฐ 5. ์ฑ ์ด๋ฆ๊ณผ ์ ์ ์ด๋ฉ์ผ ์ค์ ํ๊ธฐ > ์ ์ฅ 6. ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด > ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ๋ง๋ค๊ธฐ > OAuth ํด๋ผ์ด์ธํธ ID > ๋ง๋ค๊ธฐ 7. OAuth ํด๋ผ์ด์ธํธ ID์ secret ๋ณต์ฌํด์ ์๋ฐ ํ๋ก์ ํธ application.properties์ ์ฐ๊ธฐ. ์ด ์ ๋ณด๋ ๊ฐ๋ฐ์๋ง ์๊ณ ์์ด์ผํ๋ ์ ๋ณด์ ๋๋ค. ๊นํ๋ธ๋ ๋ฐ์ผ๋ก ๋ ธ์ถ๋์ง ์๋๋ก ์ฃผ์.. 2023. 3. 15. [GitHub] SQL ์ฝ๋ ์ธ์ ๋ชปํจ ๋ฌธ์ ์ํฉ GitHub์์๋ ๊ธฐ๋ณธ์ ์ผ๋ก SQL ์ฝ๋๋ฅผ ์ธ์ํ์ง ๋ชปํ๋ค. ํด๊ฒฐ SQL์ ํฌํจํ๋ ๋ ํฌ์งํ ๋ฆฌ์ .gitattributes๋ผ๋ ํ์ผ์ ๋ง๋ ๋ค. Add file > Create new file # .gitattributes ํ์ผ ๋ด์ฉ *.sql linguist-detectable=true *.sql linguist-language=sql ์ด์ ๋ ํฌ์งํ ๋ฆฌ์์ .sql ํ์ผ๋ค์ ์ธ์ํ์ฌ ๋ช ํผ์ผํธ๊ฐ SQL ์ฝ๋์ธ์ง ํ์ํด์ค๋ค! ์ฐธ๊ณ https://github.com/github/linguist/issues/3666 2023. 3. 12. [์๋ฌ๋ชจ์] exceeded the 'max_questions' resource ์๋ฌ ์ค๋ช ์ดํด๋ฆฝ์ค์์ ์คํ๋ง ๋ถํธ ํ๋ก์ ํธ ์คํ ์ค์ ์ฝ๋ ๊ณ์ ์์ -์ ์ฅ-์์ -์ ์ฅ ๋ฐ๋ณตํ๋ค ๋ณด๋ ์๊ธด ์๋ฌ java.sql.SQLSyntaxErrorException: User 'scott' has exceeded the 'max_questions' resource (current value: 1000) ํด๊ฒฐ 1. ์คํ ์ค์ด๋ ํ๋ก์ ํธ๋ฅผ ์ค์ง ์์ผฐ๋ค๊ฐ ๋ค์ ์คํํ๊ธฐ๋ง ํด๋ ํด๊ฒฐ ๋ ๋๊ฐ ์๋ค. 2. MySQL์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์ ์ธ์ ๋ค๋ฅธ ์ ์ ๋ก ์ ์ํด์ max_questions๋ฅผ 0์ผ๋ก ๋ฆฌ์ ํด์ค๋ค. SET @MAX_QUESTIONS=0; FLUSH PRIVILEGES; ์ถ๊ฐ ์ค๋ช max_questions๋ 1์๊ฐ ์์ MySQL์ user๊ฐ ์คํํ ์ ์๋ ์ฟผ๋ฆฌ์ ๊ฐ์์ด๋ค. ๋์ ์๋ฌ ๋ฉ์ธ์ง๋ฅผ.. 2023. 3. 8. ๋ฐฑ์คํ๋ธ ๋นจ๊ฐ ์ฒดํฌ ์๋ฌ ์ค๋ช ๋ฐฑ์ค์์ ๋ฌธ์ ๋ฅผ ๋ง์ถ๋ฉด ๋ฐฑ์คํ๋ธ๊ฐ ์๋์ผ๋ก ๋ด ๊นํ๋ธ์ ํผ ๋ฌธ์ ๋ฅผ ์ ๋ก๋ ์์ผ์ฃผ๋๋ฐ ๋นจ๊ฐ ์ฒดํฌ๊ฐ ๋ฌ๋ค๋ ๊ฒ์ ์ ๋ก๋๊ฐ ์คํจํ๋ค๋ ๊ฒ์ด๋ค. ํด๊ฒฐ ์๋ก ๋ค๋ฅธ ๋๋ฉ์ธ ๊ฐ ์ก์ธ์ค ํ ์ ์๊ฒ ๋์์ฃผ๋ CORS ํฌ๋กฌ ํ์ฅ์๋ฅผ ์ด์ฉํ๋ฉด ๋๋ค! (์ฌ๊ธฐ์ ๋ค์ด๋ฐ๊ธฐ) ํ์ฅํ๋ก๊ทธ๋จ์ ๋ค์ด ๋ฐ๊ณ ON ์ํค๋ฉด ๋ฐฑ์คํ๋ธ๊ฐ ๋ค์ ์ ์์ ์ผ๋ก ์๋ํ๋ค. CORS๋ ์น ํ์ด์ง์์ ๋ค๋ฅธ ๋๋ฉ์ธ์ ์ ๊ทผํ ๋ ํ์ํ ๋ณด์ ๋งค์ปค๋์ฆ์ด๋ค. ๋ฐฑ์ค์์ ๊นํ๋ธ ๋ฆฌ์์ค์ ์ ๊ทผํ๋ ค๋ค ๋ณด๋ ๋ฌธ์ ๊ฐ ์๊ธด๊ฒ ์๋๊น..? ์ฐธ๊ณ https://www.moesif.com/blog/technical/cors/Authoritative-Guide-to-CORS-Cross-Origin-Resource-Sharing-for-REST-APIs/ 2023. 3. 7. [์๋ฌ๋ชจ์] Failed to configure a DataSource ์๋ฌ ์ค๋ช ์ดํด๋ฆฝ์ค์์ ํ๋ก์ ํธ๋ฅผ ์คํ๋ง ๋ถํธ๋ก ์คํํ ๋ ๋๋ ์๋ฌ Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. ํด๊ฒฐ ํ๋ก์ ํธ์ application.properties ํ์ผ์ JDBC url์ ์ถ๊ฐํ๋ฉด ๋๋ค. # DataSource spring.datasource.url=jdbc:mysql://localhost:3306/[DB์คํค๋ง๋ช ]?serverTimeZone=Asia/Seoul spring.datasource.username=[DB์ ์Id] spring.datasource.password=[DB์ ์Password] spring.dataso.. 2023. 3. 3. [์๋ฌ๋ชจ์] java.lang.UnsupportedClassVersionError ์๋ฌ ์ค๋ช ์๋ฐ ์คํ๋ง ํ๋ ์์ํฌ์์ ์๋ก ํ๋ก์ ํธ๋ฅผ ๋ง๋ ํ ํ๋ก์ ํธ ์คํ ํ์ ๋ ๋น๋๊ฐ ์ ๋๋ก ๋์ง ์์ ๋๋ ์๋ฌ Exception in thread "main" java.lang.UnsupportedClassVersionError: org/springframework/boot/SpringApplication has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0 ํด๊ฒฐ ์คํ๋ง ๋ถํธ ๋ฒ์ ๋ง๊ฒ ๋ฎ์ถ๋ฉด ๋๋ค (๋์ ๊ฒฝ์ฐ๋ ์๋ 3.0.3 ์ผ๋ก ๋์ด ์๋๊ฑธ .. 2023. 3. 2. ์ด์ 1 2 3 ๋ค์