테스트 사이트 - 개발 중인 베타 버전입니다

라라벨 Google Two Factor authentification

· 6년 전 · 1527

https://scotch.io/tutorials/how-to-add-googles-two-factor-authentication-to-laravel

 

코드가 https://github.com/stephenafamo/laravel-2fa-starter

 

구글 OTP패키지는 https://github.com/antonioribeiro/google2fa-laravel 를 사용하네요.

 

QR Code는 https://github.com/Bacon/BaconQrCode

 

입니다.  

 

homestead에 위의 내용을 추가해 보겠습니다.

 

Windows에서 

 

php artisan make:auth

 

php artisan migrate

 

homestead.test 로 접속해 보시면 오른쪽 상단에  LOGIN과 REGISTER이 나타납니다.

 

composer require pragmarx/google2fa-laravel

composer require bacon/bacon-qr-code 1.0.3

2.0코드는 에러가 납니다.

 

php artisan vendor:publish --provider="PragmaRX\\Google2FALaravel\\ServiceProvider"

 

내용에 따라 코드 수정을 하세요..  ( 여기 전까지)

 

그리고 Register에서  레지스트를 하면 QR Code가 나옵니다.

 

Google Play Store에서 Google Authenticator를 다운로드 받아서 설치합니다.

 

Scan a barcode를 클릭해서 위에 나온 QR코드를 스캔합니다.

 

그러면 1분 단위로 코드가 변경되는 것을 확인 할수 있습니다.

 

이 후의 코드를 추가적으로 더 넣으시고...

 

Logout한후에 Login을 하면 아래와 같이 나오면 1분마다 바뀌는 번호를 넣으면 로그인이 되는 것을 확인할 수 있습니다.

 

 

 

아래는 조금 다르게 적용한 것인데 각자 해보세요

 

https://www.5balloons.info/two-factor-authentication-google2fa-laravel-5/

 

 

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
160
157
156
155
154
153
152
151
150
149
148
147
146
라라벨 OctoberCMS
140
134
133
132
131
130
129
128
127
126
117
116
113
106
105
일반 Faker 3
104
101