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

라라벨 Google Two Factor authentification

· 6년 전 · 1528

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/

 

 

댓글 작성

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

로그인하기

게시글 목록

번호 제목
258
256
247
246
239
라라벨 Clockwork 6
236
235
220
219
213
211
206
201
197
라라벨 Voten.co 2
193
190
185
181
179
177
171
170
169
168
167
165
164
163
162
161