Welcome Guest, Not a member yet? Register   Sign In
CI4 as backend for React.js and authentication
#9

(This post was last modified: 03-29-2022, 07:13 AM by dgvirtual.)

(03-29-2022, 12:31 AM)ignitedcms Wrote: If you store the JWT in session storage you can just use regular javascript to inspect the token and use that to validate the controllers I believe, it is something I plan to integrate into my own backlog at some point.

...

What I'd also recommend getting (when it is on sale) is picking up this course as it hand holds you through the entire process in React.

https://www.udemy.com/course/react-the-c...ncl-redux/

...

Last time I checked I don't think shield has a JWT auth although I didn't look at it for long. You most probably want to pull in a dependency. This tutorial looks decent enough, although I haven't fully interrogated it for security issues.

https://mfikri.com/en/blog/codeigniter-login-jwt

Also one more thing to add, as React out of the box doesn't have SEO, it would be sensible to get it working with something like 'nextjs' from the get go.

As you can see, the combination of all the above steps make it super difficult to maintain effectively.

My personal recommendation, is to forgo all the above and just use a PHP stack with a decent JS library (vuejs or petitevue or even alpinejs) pulled in from a CDN for the front end, as in the majority of cases you'll find the insanity of a full Javascript frontend isn't even warranted.
I am fooking for some authentication / user management library that would be accessible through restful endpoints, as described in the CI docs: https://codeigniter.com/user_guide/incom...stful.html

The Udemy course your mentioned - I am actually enrolled in it already. For my project in particular, I am trying both to learn something new and to use what I can from what I have already mastered at the same time. In my case JWT authentication does not bring any advantages over the cookie authentication, but sadly it seems I cannot have it all: I will have to implement either the user/group management or the RESTful API for an existing package that has the user/group management... Which sounds overwhelming Sad
==

Donatas G.
Reply


Messages In This Thread
RE: CI4 as backend for React.js and authentication - by dgvirtual - 03-29-2022, 02:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB