250x250
λ°μν
Notice
Recent Posts
Recent Comments
Link
μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- React
- error
- RDS
- macbook
- fastapi
- docker
- Github Actions
- github
- webhook
- 500
- springboot
- Express
- MUI
- Java
- js
- nodejs
- Jenkins
- ngrok
- javascript
- Troubleshooting
- linux
- axios
- AWS
- deploy
- AWS EC2
- MongoDB
- TypeScript
- python
- Spring
- EC2
Archives
- Today
- Total
BEAT A SHOTGUN
[TROUBLESHOOTING] 403 ERROR ON USER RESISTRATION λ³Έλ¬Έ
728x90
λ°μν
SMALL
ERROR β
π€·ββοΈ?
USER λ₯Ό REGIST νλ €νλ©΄ 403 ERROR κ° λ¬λ€.
μλ μμ§ μ무κ²λ μ λ§λ€κ³ κΆνμ΄λΌλ κ² μλ USER μ 403 ERROR
???
ROLE μ μμ§ μ λ§λ€μλλ°?
πββοΈ!!
μν! λλ Security
λ₯Ό μ¬μ©νμ§ !
μνΈνλ₯Ό μν΄ BCryptPasswordEncoder
λ μ¬μ©νμ§!
SOLUTION β
// SecurityConfig.java
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@Override
β protected void configure(HttpSecurity http) throws Exception{
http
.authorizeHttpRequests()
.antMatchers("/api/**")
.permitAll();
}
///////////////////////////////////////////////////////
@Override
β
protected void configure(HttpSecurity http) throws Exception{
http
.csrf().disable()
.authorizeHttpRequests()
.antMatchers("/api/**")
.permitAll();
}
}
.csrf().disable()
ββ
CAUTION
ββ
κ·Έλ λ€κ³ 무μμ csrf
λ₯Όdisable
λ‘ νλ©΄ μ λλ€.
λλ νΌμ μΉμ¬μ΄νΈλ₯Ό λ§λ€κ³ μλ κ±°κΈ° λλ¬Έμ μ΄λ κ² μ¬μ©νμ§λ§, λμ€μ token
μ μ¬μ©νλ€λκ° λ€λ₯Έ λ°©λ²μΌλ‘ csrf
λ₯Ό μμ ν΄μΌ νλ€.
λ
γ γ μ΄μ 500 μλ¬λ€ γ γ γ γ γ γ
π
728x90
λ°μν
LIST
'TROUBLESHOOTING' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[ERROR] Set up a proxy and set up multiple proxies (0) | 2022.11.11 |
---|---|
[TROUBLESHOOTING] 500 ERROR - cannot deserialize from object value (0) | 2022.10.21 |
[TROUBLESHOOTING] Error executing DDL "alter table post drop foreign key **** (0) | 2022.10.18 |
[IntelliJ] Set to Control Font-size with 'Ctrl + Mouse' (0) | 2022.10.14 |
[TROUBLESHOOTING] NODE.JS PROJECT NPM INIT ERROR (0) | 2022.10.05 |
Comments