전체 글

전체 글

    Security 설정, Data 설정

    401 unauthorized 해결을 위한 Security 설정 package com.example.jwttutorial.config; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @EnableWebSecurity // 기본적인 Web 보안을 활성화 public cl..

    JWT 소개

    JWT 소개

    JWT(JSON Web Token)는 RFC 7519 웹 표준으로 지정이 되어있고 JSON 객체를 사용해서 토큰 자체에 정보들을 저장하고 있는 Web Token이라고 정의 할 수 있습니다. Header, Payload, Signature로 구성되어있다. aaaaaa.bbbbbbb.ccccccc -> (header.payload.signature) Header : Signature를 해싱하기 위한 알고리즘 정보들이 담겨 있다. Payload : 서버와 클라이언트가 주고받는, 시스템에서 실제로 사용될 정보에 대한 내용들을 담고 있습니다. Signature : 토큰의 유효성 검증을 위한 문자열입니다. 이 문자열을 통해 서버에서는 이 토큰이 유효한 토큰인지를 검증할 수 있습니다. 장점 중앙의 인증 서버, 데이터..

    컨베이어 벨트 위의 로봇 - 20055번

    컨베이어 벨트 위의 로봇 - 20055번

    package com.company; import java.io.*; import java.util.*; public class Main { static int stage, count, N, K, size; static int[][] arr; static ArrayList robots = new ArrayList(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.next..

    도노미노도미노 2 - 20061번

    도노미노도미노 2 - 20061번

    package com.company; import java.io.*; import java.util.*; public class Main { static int count; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = null; count = 0; ArrayList[] blue = new ArrayList[4]; ArrayList[] green = new ArrayList[4]; for (int i = 0; i < 4; i++) { blue[i] = new ArrayList(..

    미로탈출

    미로탈출

    현재 방 == TRAP 이고 이동할 방 == TRAP 인 경우 현재 방 == TRAP 이고 이동할 방 != TRAP 인 경우 현재 방 != TRAP 이고 이동할 방 == TRAP 인 경우 현재 방 != TRAP 이고 이동할 방 != TRAP 인 경우 크게 네가지로 나눠서 생각했다. 그 다음 각 경우 내부에서 현재 방, 이동할 방 중 TRAP이 2개 또는 0개 인 경우와 1개인 경우 이 두가지로 나눠서 풀이 했다. package com.company; import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new Bu..

    주사위 윷놀이 - 17825번

    주사위 윷놀이 - 17825번

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] blue = {{10, 13, 16, 19, 25, 30, 35, 40}, {20, 22, 24, 25, 30, 35, 40}, {30, 28, 27, 26, 25, 30, 35, 40}}; static boolean[] check, checkBlue; static int[][] horse; static int[] move = new int[10]; static int answer = 0; public static void main(String[] args) throws IOException { BufferedReader br = new ..

    원판돌리기 - 17822번

    원판돌리기 - 17822번

    package com.company; import java.io.*; import java.util.*; public class Main { static ArrayList[] list; static int N, M, T; static int[][] d = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.next..

    새로운 게임 2

    새로운 게임 2

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] d = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}}; static int[][] horse, arr; static int N, K, answer; static boolean check; static ArrayList[][] list; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new Stri..

    게리맨더링 2 - 17779번

    게리맨더링 2 - 17779번

    package com.company; import java.io.*; import java.util.*; public class Main { static int[][] arr, check, startPoint; static boolean[][] visited; static int[][] d = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; static int N, answer; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = null; answer = Integ..

    연구소 3 -17142번

    연구소 3 -17142번

    package com.company; import java.io.*; import java.util.*; public class Main { static ArrayList virus; static int[][] arr; static int[][] d = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; static int N, M, count, answer; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()..