# I need to do token based authentication

**URL:** <https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289>\
**Category:** Need Help\
**Created:** [May 12, 2018, 12:17pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289 "2018-05-12T12:17:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay07roy](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vijay07roy](https://discourse.cakephp.org/u/vijay07roy)\
**Post date:** [May 12, 2018, 12:17pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/1 "2018-05-12T12:17:29Z")

</div>

I have followed this link [https://book.cakephp.org/3.0/en/tutorials-and-examples/cms/installation.html](https://book.cakephp.org/3.0/en/tutorials-and-examples/cms/installation.html) and create a cms. I want to change the login system disabling the has password. Please help. Thank you.

---

<div class="post-metadata">

**Author:** ![zhunt](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zhunt](https://discourse.cakephp.org/u/zhunt)\
**Post date:** [May 14, 2018, 1:20am UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/2 "2018-05-14T01:20:39Z")

</div>

Sorry, not an answer, but thanks, I never saw that tutorial before 🙂

By token-based you mean you want to access it like an API for a JavaScript front-end?

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [May 14, 2018, 2:31pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/3 "2018-05-14T14:31:58Z")

</div>

there is nice tutorial for JWT token based login [http://www.bravo-kernel.com/2015/04/how-to-add-jwt-authentication-to-a-cakephp-3-rest-api/](http://www.bravo-kernel.com/2015/04/how-to-add-jwt-authentication-to-a-cakephp-3-rest-api/)

---

<div class="post-metadata">

**Author:** ![vijay07roy](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vijay07roy](https://discourse.cakephp.org/u/vijay07roy)\
**Post date:** [May 17, 2018, 2:39pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/4 "2018-05-17T14:39:17Z")

</div>

no mention. I mean token based authentication in cakephp.

---

<div class="post-metadata">

**Author:** ![vijay07roy](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vijay07roy](https://discourse.cakephp.org/u/vijay07roy)\
**Post date:** [May 17, 2018, 2:42pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/5 "2018-05-17T14:42:22Z")

</div>

yeah thanks. I have followed. There are a lot of thing that i don’t need in this tutorial. this tutorial is very difficult to follow. i am not getting the excite things needed.

---

<div class="post-metadata">

**Author:** ![zhunt](https://avatars.discourse-cdn.com/v4/letter/z/958977/32.png) [@zhunt](https://discourse.cakephp.org/u/zhunt)\
**Post date:** [May 21, 2018, 6:29pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/6 "2018-05-21T18:29:21Z")

</div>

This might help with the tokens, basically uses a JWT (Java Web Token) along with Multidots’ API plug-in.

> **[multidots/cakephp-rest-api](https://github.com/multidots/cakephp-rest-api)**
>
> CakePHP 3 plugin for building REST API services. Contribute to multidots/cakephp-rest-api development by creating an account on GitHub.

(the link on github isn’t working at the moment, this is mean to be the link I think)

> **[CakePHP: Build REST APIs with RestApi plugin – Narendra Vaghela – Medium](https://medium.com/@narendravaghela/cakephp-build-rest-apis-with-restapi-plugin-1-c55b73fb9c0)**
>
> A guide to build REST APIs in CakePHP 3 application using RestApi plugin.

---

<div class="post-metadata">

**Author:** ![vijay07roy](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vijay07roy](https://discourse.cakephp.org/u/vijay07roy)\
**Post date:** [May 24, 2018, 5:41pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/7 "2018-05-24T17:41:47Z")

</div>

thank you for sharing it.

---

<div class="post-metadata">

**Author:** ![vijay07roy](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vijay07roy](https://discourse.cakephp.org/u/vijay07roy)\
**Post date:** [May 24, 2018, 5:44pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/8 "2018-05-24T17:44:56Z")

</div>

[https://tutel.me/c/programming/questions/41143395/cakephp+3+api+does+not+authenticate+user+token](https://tutel.me/c/programming/questions/41143395/cakephp+3+api+does+not+authenticate+user+token) this link help me completing the task

---

<div class="post-metadata">

**Author:** ![paulncks](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@paulncks](https://discourse.cakephp.org/u/paulncks)\
**Post date:** [May 26, 2022, 6:14pm UTC](https://discourse.cakephp.org/t/i-need-to-do-token-based-authentication/4289/9 "2022-05-26T18:14:12Z")

</div>

If you are using the simple Token from the Authentication plugin, you have to store your valid tokens in a database:  
[https://book.cakephp.org/authentication/2/en/identifiers.html#token](https://book.cakephp.org/authentication/2/en/identifiers.html#token)

Also, look into this plugin if you want to generate tokens:

> **[GitHub - UseMuffin/Tokenize: Security tokens for CakePHP](https://github.com/UseMuffin/Tokenize)**
>
> Security tokens for CakePHP. Contribute to UseMuffin/Tokenize development by creating an account on GitHub.
