SlideShare a Scribd company logo
Laravel Authentication
구준호
XE3를 지탱하는 기술
할 일
1. Laravel Authentication?
2. 가입, 로그인
3. 패스워드 리셋
4. 남은 이야기
1. 테이블 필드 추가
2. Socialite
1. Laravel Authentication?
Laravel Authentication
1. Laravel Authentication?
• 장점 :
• 환상적인 기능들을 별다른 설치 없이도 사용 가능합니다.
• 쉽게쉽게(!) 바로 쓸 수 있습니다.
• 오늘 해볼 기능들
1. 가입, 로그인
2. 패스워드 리셋
• 실습
• 개발자 구인구직 사이트의 인증 기능을 살펴봅니다.
2. 가입, 로그인
Laravel Authentication
2. 가입, 로그인 – 로그인 화면
2. 가입, 로그인 – AuthController
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
trait trait
trait
AuthController
routes.php
AuthController
2. 가입, 로그인 – trait, use
2. 가입, 로그인 – AuthController
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
AuthController
routes.php
AuthController
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
2. 가입, 로그인 – AuthController
AuthController
routes.php
AuthController
2. 가입, 로그인 – AuthController
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
AuthController
routes.php
AuthController
AuthController
2. 가입, 로그인 – AuthController
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
routes.php
AuthController
2. 가입, 로그인 – routes.php
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
AuthController
AuthController::
postLogin()
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
AuthController
AuthController::getLogout()
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
AuthController
AuthController::postRegister()
AuthenticatesUsers RegistersUsers
AuthenticatesAndRegistersUsers
AuthController
2. 가입, 로그인 – Auth 의 다른 기능들
• Auth::viaRemember();
• Auth::login($user);
• Auth::loginUsingId(1);
• Auth::once($credentials);
2. 가입, 로그인 – 구직 사이트 개발
• 가입, 로그인
• 패스워드 변경
2. 가입, 로그인 – routes.phpproject/app/Http/routes.php
2. 가입, 로그인 – 가입 화면project/resources/views/auth/register.blade.php
2. 가입, 로그인 – 로그인 화면project/resources/views/auth/login.blade.php
2. 가입, 로그인 – 로그인 시도 후 redirectproject/app/Http/Controllers/Auth/AuthController.php
3. 패스워드 리셋
Laravel Authentication
3. 패스워드 리셋
3. 패스워드 리셋 – PasswordController
ResetsPasswords
trait
• 패스워드 초기화
routes.php
Password
Controller
PasswordController
3. 패스워드 리셋 – PasswordController
• 패스워드 초기화
routes.php
Password
Controller
ResetsPasswords
PasswordController
3. 패스워드 리셋 – PasswordController
• 패스워드 초기화
routes.php
Password
Controller
ResetsPasswords
PasswordController
3. 패스워드 리셋 – routes.php
ResetsPasswords
PasswordController
3. 패스워드 리셋 – 구직 사이트 개발
• 가입, 로그인
• 패스워드 변경
3. 패스워드 리셋 – routes.phpproject/app/Http/routes.php
3. 패스워드 리셋 – 메일 설정project/.env
3. 패스워드 리셋 – 메일 설정project/config/mail.php
3. 패스워드 리셋 – 리셋 요구 폼project/resources/views/auth/password.blade.php
3. 패스워드 리셋 – 이메일 내용project/resources/views/emails/password.blade.php
3. 패스워드 리셋 – 리셋 확인 폼project/resources/views/auth/reset.blade.php
4. 남은 이야기
Laravel Authentication
4. 사용자 테이블 필드 추가
• 가입, 로그인
• 패스워드 변경
• 사용자 테이블 필드 추가
• 소셜 로그인
4. 사용자 테이블 필드 추가 – 코멘트 팁
//*
content1()
/*/
content2()
//*/
/*
content1()
/*/
content2()
//*/
project/app/Http/routes.php
화면(O)
4. 사용자 테이블 필드 추가 – Migrationproject/database/migrations/add_resume_field_on_users_table.php
4. 사용자 테이블 필드 추가 – Userproject/app/User.php
4. 사용자 테이블 필드 추가 – Controllerproject/app/Http/Controllers/Auth/AuthController2.php
4. 소셜 로그인
• 가입, 로그인
• 패스워드 변경
• 사용자 테이블 필드 추가
• 소셜 로그인
4. 소셜 로그인 – Socialite
• Laravel 에서 제공
• 폼 기반 인증이 아닌 OAuth 기반 인증 방식
• composer를 통해서 설치 필요
• http://xpressengine.github.io/laravel-korean-docs/docs/5.0/authentication/#social-authentication
composer require laravel/socialite
콘솔창에서 다음처럼 입력
4. 소셜 로그인 – 등록
Socilite 사용하기 위해서 Github App 등록
4. 소셜 로그인 – ServiceProviderproject/config/app.php
4. 소셜 로그인 – 설정project/config/services.php
4. 소셜 로그인 – routes.phpproject/app/Http/routes.php
4. 소셜 로그인 – 소셜 인증과 콜백project/app/Http/Controllers/Auth/AuthController3.php
오늘 한 일
1. 가입, 로그인
2. 패스워드 리셋
3. 테이블 필드 추가
4. Socialite
Q&A
감사합니다

More Related Content

Similar to Laravel Authentication

ASP.NET 4 New Features
ASP.NET 4 New FeaturesASP.NET 4 New Features
ASP.NET 4 New Features
SangHoon Han
 
XECON2014 Laravel 프레임워크 소개
XECON2014 Laravel 프레임워크 소개XECON2014 Laravel 프레임워크 소개
XECON2014 Laravel 프레임워크 소개
Jung soo Ahn
 
Restful API guide
Restful API guideRestful API guide
Restful API guide
Benjamin Kim
 
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API 안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
Gosu Ok
 
REST API 디자인 개요
REST API 디자인 개요REST API 디자인 개요
REST API 디자인 개요
nexusz99
 
F3 네이버오픈api만드는매쉬업
F3 네이버오픈api만드는매쉬업F3 네이버오픈api만드는매쉬업
F3 네이버오픈api만드는매쉬업NAVER D2
 
스프링시큐리티와 소셜연습 이해를 위한 글
스프링시큐리티와 소셜연습 이해를 위한 글스프링시큐리티와 소셜연습 이해를 위한 글
스프링시큐리티와 소셜연습 이해를 위한 글
라한사 아
 
소셜 네트워크 앱 개발
소셜 네트워크 앱 개발소셜 네트워크 앱 개발
소셜 네트워크 앱 개발Kenu, GwangNam Heo
 
Word camp seoul-2012-track3-3
Word camp seoul-2012-track3-3Word camp seoul-2012-track3-3
Word camp seoul-2012-track3-3
082net
 
Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]
Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]
Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]
Jaeman An
 
Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료
Han Sung Kim
 
XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기
XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기
XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기
승훈 오
 
Laravel 06.Request LifeCyle
Laravel 06.Request LifeCyleLaravel 06.Request LifeCyle
Laravel 06.Request LifeCyle
hojin lee
 
Open source APM Scouter로 모니터링 잘 하기
Open source APM Scouter로 모니터링 잘 하기Open source APM Scouter로 모니터링 잘 하기
Open source APM Scouter로 모니터링 잘 하기
GunHee Lee
 
Tks프로젝트v2
Tks프로젝트v2Tks프로젝트v2
Tks프로젝트v2
jrlim80
 
Web App Security 2015.10
Web App Security 2015.10Web App Security 2015.10
Web App Security 2015.10
Chanjin Park
 
Class overview
Class overviewClass overview
Class overview
이경주 이경주
 
Opensource APM SCOUTER in practice
Opensource APM SCOUTER in practiceOpensource APM SCOUTER in practice
Opensource APM SCOUTER in practice
GunHee Lee
 
SJBoard Project Portfolio
SJBoard Project PortfolioSJBoard Project Portfolio
SJBoard Project Portfolio
JuyoungKang7
 
반복적인 코드 작업 자동화, Codebone으로 손쉽게
반복적인 코드 작업 자동화, Codebone으로 손쉽게반복적인 코드 작업 자동화, Codebone으로 손쉽게
반복적인 코드 작업 자동화, Codebone으로 손쉽게
Sungju Jin
 

Similar to Laravel Authentication (20)

ASP.NET 4 New Features
ASP.NET 4 New FeaturesASP.NET 4 New Features
ASP.NET 4 New Features
 
XECON2014 Laravel 프레임워크 소개
XECON2014 Laravel 프레임워크 소개XECON2014 Laravel 프레임워크 소개
XECON2014 Laravel 프레임워크 소개
 
Restful API guide
Restful API guideRestful API guide
Restful API guide
 
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API 안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
 
REST API 디자인 개요
REST API 디자인 개요REST API 디자인 개요
REST API 디자인 개요
 
F3 네이버오픈api만드는매쉬업
F3 네이버오픈api만드는매쉬업F3 네이버오픈api만드는매쉬업
F3 네이버오픈api만드는매쉬업
 
스프링시큐리티와 소셜연습 이해를 위한 글
스프링시큐리티와 소셜연습 이해를 위한 글스프링시큐리티와 소셜연습 이해를 위한 글
스프링시큐리티와 소셜연습 이해를 위한 글
 
소셜 네트워크 앱 개발
소셜 네트워크 앱 개발소셜 네트워크 앱 개발
소셜 네트워크 앱 개발
 
Word camp seoul-2012-track3-3
Word camp seoul-2012-track3-3Word camp seoul-2012-track3-3
Word camp seoul-2012-track3-3
 
Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]
Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]
Advanced Python Testing Techniques (Pycon KR 2019) [Korean Ver.]
 
Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료Django로 배우는 쉽고 빠른 웹개발 study 자료
Django로 배우는 쉽고 빠른 웹개발 study 자료
 
XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기
XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기
XE3 a부터 z까지(1) xe3 구조와 간단한 페이지 만들기
 
Laravel 06.Request LifeCyle
Laravel 06.Request LifeCyleLaravel 06.Request LifeCyle
Laravel 06.Request LifeCyle
 
Open source APM Scouter로 모니터링 잘 하기
Open source APM Scouter로 모니터링 잘 하기Open source APM Scouter로 모니터링 잘 하기
Open source APM Scouter로 모니터링 잘 하기
 
Tks프로젝트v2
Tks프로젝트v2Tks프로젝트v2
Tks프로젝트v2
 
Web App Security 2015.10
Web App Security 2015.10Web App Security 2015.10
Web App Security 2015.10
 
Class overview
Class overviewClass overview
Class overview
 
Opensource APM SCOUTER in practice
Opensource APM SCOUTER in practiceOpensource APM SCOUTER in practice
Opensource APM SCOUTER in practice
 
SJBoard Project Portfolio
SJBoard Project PortfolioSJBoard Project Portfolio
SJBoard Project Portfolio
 
반복적인 코드 작업 자동화, Codebone으로 손쉽게
반복적인 코드 작업 자동화, Codebone으로 손쉽게반복적인 코드 작업 자동화, Codebone으로 손쉽게
반복적인 코드 작업 자동화, Codebone으로 손쉽게
 

Laravel Authentication

Editor's Notes

  1. 가입, 로그인 로그인 상태 유지 사용자 입력 검증 에러 메세지 스로틀 로그인
  2. 각 traits 들을 설명해야 함 (그래야 뒤에서 선택 질문 가능)
  3. 패스워드 리셋 메일 전송
  4. AuthController2를 상속 callback 설명