Skip to content

Springboot-Security: ๐Ÿ” ์ธ์ฆ/์ธ๊ฐ€ ์ธํ”„๋ผ ์ƒ˜ํ”Œ

Notifications You must be signed in to change notification settings

Caramel1004/springboot-security-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

์‚ฌ์šฉ๋œ ๊ธฐ์ˆ  ์Šคํƒ

  • ๊ฐœ๋ฐœ ์–ธ์–ด: java 17
  • ํ”„๋ ˆ์ž„์›Œํฌ: springboot 3.2.3
  • DB: H2
  • ์œ ํ‹ธ: JPA
  • ๋‹จ์œ„ ํ…Œ์ŠคํŠธ: junit5
  • ๋นŒ๋“œ ํ™˜๊ฒฝ: gradle
  • ์ž‘์—… ํˆด: intellij

Reference docs

Spring Security ๊ณต์‹ ์ฐธ๊ณ  ๋ฌธ์„œ
https://docs.spring.io/spring-security/reference/index.html

Spring Security ์ ์šฉ ์ฝ”๋“œ
https://docs.spring.io/spring-security/reference/servlet/authentication/index.html


Spring Security๋ž€?

[์˜์–ด]

Spring Security is a powerful and highly customizable authentication and access-control framework.

  • It is the de-facto standard for securing Spring-based applications.
  • Spring Security is a framework that focuses on providing both authentication and authorization to Java applications.
  • Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements.

[ํ•œ๊ตญ์–ด]

Spring Security๋Š” ๊ฐ•๋ ฅํ•˜๊ณ  ์‚ฌ์šฉ์ž ์ •์˜๊ฐ€ ๊ฐ€๋Šฅํ•œ ์ธ์ฆ ๋ฐ ์•ก์„ธ์Šค ์ œ์–ด ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค.

  • Spring ๊ธฐ๋ฐ˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ณด์•ˆ์„ ์œ„ํ•œ ์‚ฌ์‹ค์ƒ์˜ ํ‘œ์ค€์ž…๋‹ˆ๋‹ค.
  • Spring Security๋Š” Java ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์ธ์ฆ๊ณผ ๊ถŒํ•œ ๋ถ€์—ฌ๋ฅผ ๋ชจ๋‘ ์ œ๊ณตํ•˜๋Š” ๋ฐ ์ค‘์ ์„ ๋‘” ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค.
  • ๋ชจ๋“  Spring ํ”„๋กœ์ ํŠธ์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ Spring Security์˜ ์ง„์ •ํ•œ ํž˜์€ ์‚ฌ์šฉ์ž ์ •์˜ ์š”๊ตฌ ์‚ฌํ•ญ์„ ์ถฉ์กฑํ•˜๊ธฐ ์œ„ํ•ด ์–ผ๋งˆ๋‚˜ ์‰ฝ๊ฒŒ ํ™•์žฅํ•  ์ˆ˜ ์žˆ๋Š”์ง€์— ์žˆ์Šต๋‹ˆ๋‹ค.

์ถœ์ฒ˜: Spring Security ๊ณต์‹ ๋ฌธ์„œ
https://spring.io/projects/spring-security#overview


Spring Security ํŠน์ง•

  1. ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ชจ๋“  ๋ฆฌ์†Œ์Šค๋ฅผ ๋ณดํ˜ธํ•ฉ๋‹ˆ๋‹ค.
  2. ํผ ๊ธฐ๋ฐ˜ ์ธ์ฆ์ด ๊ธฐ๋ณธ์ ์œผ๋กœ ์‚ฌ์šฉ ์„ค์ •๋˜๋Š” ์ธ์ฆ ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค.
  3. ๋กœ๊ทธ์ธํ•˜๋ฉด ์„ธ์…˜ ID๊ฐ€ ์ƒ์„ฑ๋˜๊ณ  ์„ธ์…˜ID๋Š” ์ฟ ํ‚ค์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

Spring Security ํผ ๊ธฐ๋ฐ˜ ์ธ์ฆ์˜ ์•„์ด๋”” ํŒจ์Šค์›Œ๋“œ ์„ค์ •

  • ๋งค๋ฒˆ ์„œ๋ฒ„๊ฐ€ ์‹คํ–‰๋ ๋•Œ ๋งˆ๋‹ค ๋™์ ์ธ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
    ํŽธ์˜๋ฅผ ์œ„ํ•ด ์ •์ ์ธ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์ œ๊ณตํ•˜๋ ค๋ฉด ํ™˜๊ฒฝ ์„ค์ •์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • application.properties ํŒŒ์ผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
  • ์•„๋ž˜์™€ ๊ฐ™์ด ์›ํ•˜๋Š” name๊ณผ password๋ฅผ ํ™˜๊ฒฝ์„ค์ • ํ•ฉ๋‹ˆ๋‹ค.
spring.security.user.name=admin
spring.security.user.password=auth

About

Springboot-Security: ๐Ÿ” ์ธ์ฆ/์ธ๊ฐ€ ์ธํ”„๋ผ ์ƒ˜ํ”Œ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages