1 Star 0 Fork 1

levent / passport-server-client-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Laravel Passport API Demo

Simple mini-project with Laravel 5.5 Passport Server and a Client (Laravel 5.5 + Vue.js 2) to authorize and get some data from API.

How it works

  1. You launch Client URL and see button Login with Passport

Login with Passport

  1. You enter credentials from Server database's Users table and log in. Then you get to Authorize the client.

Passport Authorize

  1. Then you see a Sample CRUD Projects where all data management is done via API calls to the Server.

Passport Projects


How to use

There are actually two different (but tied together) projects in this repository, so you see the folders.

First, Clone the repository and map your client and server domains separately to folder /passport-client and /passport-server from the repository.

Then, we need to take care of Server and Client separately.

Step 1. Install and configure Passport Server

  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
  7. Run php artisan passport:keys

Step 2. Install and configure Passport Client

  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:
  • APP_CLIENT_ID=[oauth_clients.id value]
  • API_CLIENT_SECRET=[oauth_clients.secret value]
  • API_URL = http(s)://[your_server_url]

Step 3. Launch client

That's it, launch your client URL, click Login with Passport and enter default credentials: admin@admin.com - password.


License

Please use and re-use however you want.

空文件

简介

基于laravel框架,使用passport,oauth实现的认证的API server和app-client demo。既然可以让终端用户管理自己的数据,同时又可以让消费用户数据的三方开发者在获得用户许可的情况下,请求该用户的信息资源。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/levent123_admin/passport-server-client-demo.git
git@gitee.com:levent123_admin/passport-server-client-demo.git
levent123_admin
passport-server-client-demo
passport-server-client-demo
master

搜索帮助