Migrate from Basic Authetication to Json Web Token Auth

Hi, As we know Moqui framework use basic authentication method for handling authentication!
I want to use jwt authentication instead of basic, what is best approach to do?
Frontend: next js
Backend: Moqui

Why do you need to use jwt instead of basic HTTP authentication?

Hi, my frontend application is react and i want to use moqui for backend,
frontend app using jwt for interact with backend, thats why i want to use jwt!!

1 Like

I’m assuming you want to call rest services through a jwt mechanism, and pass in parameters through jwt. The closest thing that I am aware of is the mkdecisiondev/moqui-pac4j-integration here.
You’ve got a couple decisions

  • You could put something together that would use a similar pattern to what MkDecision did. However that is specifically built for MkDecision, and may not apply to your needs.
  • The framework could be extended to allow for jwt authentication instead of just basic authentication for rest services and transitions although that would take a lot of code.
  • You could write a wrapper for each service that you need that takes in a jwt parameter, does the validation necessary, and if the validation is correct calls the services and returns a response (at the start this is what I would choose).

Let me know if you have more questions

1 Like

Thank You michael…

1 Like

You’re welcome. Happy to help!