Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CakePHP JWT authentication demo using Authentication plugin

License

NotificationsYou must be signed in to change notification settings

ishanvyas22/cakephp-jwt-authentication-demo

Repository files navigation

This project is proof of concept on implementation of JWT authentication in CakePHP usingAuthentication plugin.

Installation

  1. Download the repo locally:

    git clone git@github.com:ishanvyas22/cakephp-jwt-authentication-demo.gitcd cakephp-jwt-authentication-demo
  2. Install PHP dependencies:

    composer install
  3. Read and edit the environment specificconfig/app_local.php and setup the'Datasources' and any other configuration relevant for your application. Other environment agnostic settings can be changed inconfig/app.php.

  4. Run database migrations & seeders:

    bin/cake migrations migratebin/cake migrations seed --seed=DatabaseSeed
  5. Run the dev server (the output will give the address):

    bin/cake server

That's all!

Usage

Generate JWT token

You can send aPOST request to/api/users/login.json URL with below details:

  • Username: john
  • Password: secret

It will return JWT token in json response.

Get User Information

To get authenticated user's information you have to make aGET request to/api/users.json URL with the token you got from previous step in theAuthorization header withBearer prefix.

❤️ Support The Development

Do you like this project? Support it by donating:

Buy Me A Coffee

orPaypal me

License

The MIT License (MIT). Please seeLicense File for more information.

About

CakePHP JWT authentication demo using Authentication plugin

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp