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

Laravel Passport API Server Client DEMO

· 6년 전 · 1332

https://github.com/LaravelDaily/Laravel-Passport-API-Server-Client-Demo

 

라라벨 패스포트에서 Oauth 2.0중에서 페이스북이나 구글 어카운트를 통해서 로그인 가능하게 하는 것에 대한 데모입니다. (소셜 로그인..)

 

아래 내용은 사이트에서 카피한 것인데 

 

Step 1. Install and configure Passport Server

laragon에서 안하고 php artisan serve로..

  1. Go to folder /passport-server in your Terminal or Command Prompt
  2. Copy .env.example to .env and fill in your database credentials
  3. Run composer install
  4. Run php artisan key:generate
  5. Run php artisan migrate --seed
  6. Run php artisan passport:client - enter ID equals 1, name can be whatever, and callback should be http(s)://[your_client_url]/callback ( http://passport-client.test/callback )
  7. Run php artisan passport:keys
  8. php artisan serve 로 localhost:8000 으로 접속이 가능합니다.

Step 2. Install and configure Passport Client

* laragon에서 돌립니다.

  1. Go to folder /passport-client in your Terminal or Command Prompt
  2. Copy .env.example to .env
  3. Run composer install
  4. Run php artisan key:generate
  5. In .env fill in these variables from Server Database:
  • API_CLIENT_ID=[oauth_clients.id value]
  • API_CLIENT_SECRET=[oauth_clients.secret value]
  • API_URL = http(s)://[your_server_url]

API_URL=http://localhost:8000

API_CLIENT_ID=5

API_CLIENT_SECRET=K8V4JHGzLPnaSgQ9NsUsTrJpWf8Vy1FaixUEvjVs

 

ID와 client Secret는 본인것으로 ..

 

웹브라우저에서 passport-client.test로 접속 하셔서 아이디: admin@admin.com 패스워드 password 로 접속해서 서버에서 authorize해 주는 과정등을 볼수 있습니다. 

 

예전에 잘 모를 때 그누보드에 붙여 보겠다고 했던 기억이 새롭네요..

https://sir.kr/so_app/81

 

댓글 작성

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

로그인하기

게시글 목록

번호 제목
394
393
392
391
390
388
387
386
374
369
368
367
366
365
364
363
362
361
360
359
358
357
356
354
350
344
343
342
341
340