본문 바로가기
반응형

Framework52

[Laravel] Excel Import 사용하기 구성 : Laravel Framework 8.46 https://github.com/Maatwebsite/Laravel-Excel 위 패키지를 이용하여 진행해 보겠다. 1. 패키지 설치 composer require maatwebsite/excel 2. Provider, alias 추가 // config/app.php 'providers' => [ . . . Maatwebsite\Excel\ExcelServiceProvider::class, ] 'aliases' => [ . . 'Excel' => Maatwebsite\Excel\Facades\Excel::class, ] 3. vendoir publish 실행 php artisan vendor:publish --provider="Maatwebsite\Ex.. 2021. 6. 16.
[Laravel] JWT API Server 구축하기(2) 구성 : Laravel Framework 8.42.1 2021.05.21 - [Framework/Laravel Framework] - [Laravel] JWT API Server 구축하기(1) 이번 포스팅에서는 User 모델 이외에 Admin 모델을 만들어 multiple jwt 인증을 진행해보겠다. Admin Model 추가 User Model과 내용은 동일하다. migration도 users table과 동일하게 구성했다. php artisan make:model Admin 2021. 5. 25.
[Laravel] JWT API Server 구축하기(1) 구성 : Laravel Framework 8.42.1 들어가기 앞서, JWT, OAuth 의 개념을 알고 있다면 더욱 쉽게 접근 가능 할 것 같다. 2021.05.01 - [보안] - [JWT] JSON Web Token 이란? 2021.05.01 - [보안] - [OAuth] OAuth 2.0 이란? tymon-jwt 패키지를 이용해 실습해 볼것이다. https://github.com/tymondesigns/jwt-auth tymondesigns/jwt-auth 패키지 설치하기 composer 명령어를 이용해서 tymon/jwt-auth 패키지를 설치한다. composer require tymon/jwt-auth publish 명령을 실행한다. php artisan vendor:publish --pro.. 2021. 5. 21.
[Spring Boot] Spring Security 세션 인증 정책 예제 동시 세션 제어 이전 사용자 세션 만료 현재 사용자 인증 실패 @Override protected void configure(HttpSecurity http) throws Exception { // 세션 관리 기능 작동 http.sessionManagement() .maximumSessions(1) // 최대 허용 가능 세션 수, -1 : 무제한 로그인 세션 허용 .maxSessionsPreventsLogin(true) // 동시 로그인 차단, false : 기존 세션 만료(defualt) .invalidSessionUrl("/invalid") // 세션이 유효하지 않을 때 이동할 URL .expiredUrl("/expired") // 세션이 만료된 경우 이동할 URL } 세션 고정 보호 @Overrid.. 2021. 5. 7.
[Spring Boot] Spring Security Remember Me 인증 개념 세션이 만료되고 웹 브라우저가 종료된 후에도 어플리케이션이 사용자를 기억하는 기능 Remember-Me 쿠키에 대한 Http 요청을 확인한 후 토큰 기반 인증을 사용해 유효성을 검사하고 토큰이 검증되면 사용자는 로그인 된다. HttpSecurity @Override protected void configure(HttpSecurity http) throws Exception { http.rememberMe() .rememberMeParameter("remember") // 기본 파라미터명은 remember-me .tokenValiditySeconds(3600) // default : 14 days // default : false, remember-me 기능이 활성화되지않아도 항상 실행 .always.. 2021. 5. 3.
[Spring Boot] Spring Security 로그아웃 처리 HttpSecurity @Override protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception { http.logout() // 로그아웃 처리 .logoutUrl("/logout") // 로그아웃 처리 URL .logoutSuccessUrl("/login") // 로그아웃 성공 후 이동 URL .deleteCookies(" JESSIONID", " remember-me ") // 로그아웃 후 쿠키 삭제 .addLogoutHandler(logoutHandler()) // 로그아웃 후 핸들러 .logoutSuccessHandler(logout.. 2021. 5. 2.
반응형