고요빛물결

Laravel Passport API Server Client DEMO

· 2019-01-08 (화) 12:21:02 · 2024

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로 접속 하셔서 아이디: [email protected] 패스워드 password 로 접속해서 서버에서 authorize해 주는 과정등을 볼수 있습니다. 

 

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

https://sir.kr/so_app/81

 

댓글을 작성하시려면 로그인이 필요합니다.
+
분류 제목 글쓴이 날짜 조회
라라벨 17-11-11 조회 2,318
라라벨 17-11-10 조회 2,112
라라벨 17-11-07 조회 3,039
기타 17-10-31 조회 2,410
기타 17-10-30 조회 1,796
라라벨
[라라벨]
17-10-29 조회 1,911
기타 17-10-28 조회 2,304
기타 17-10-28 조회 1,908
라라벨 17-10-27 조회 3,598
기타 17-10-03 조회 3,149
기타 17-09-21 조회 2,219
라라벨 17-09-21 조회 2,434
라라벨 17-09-20 조회 2,485
라라벨 17-09-01 조회 2,428
라라벨
[라라벨]
17-06-30 조회 1,819
코드이그나이터 17-06-25 조회 2,912
코드이그나이터 17-06-23 조회 2,258
코드이그나이터 17-06-22 조회 2,873
라라벨 17-06-20 조회 3,312
일반 17-06-15 조회 1,972
일반 17-06-10 조회 2,400
기타 17-06-09 조회 2,742
라라벨 17-05-15 조회 1,811
라라벨 17-05-15 조회 1,834
라라벨 17-05-15 조회 1,919
기타 17-05-10 조회 1,955
기타 17-04-11 조회 2,110
라라벨 17-04-11 조회 2,562
라라벨 17-04-11 조회 1,856
기타 17-04-10 조회 2,156