Making-Websites-With-October-CMS
Making-Websites-With-October-CMS copied to clipboard
Extending user plugin for authentication
I want to create a plugin to extend User plugin in a way it authenticates the users through an external API rather than what User plugin normally does. After successful login a cookie will be saved for user to be used for subsequent requests to the REST API.
The external service provider needs the username/password or a cookie to be sent with each request, so I want to use the cookie rather than saving user's credentials in a table. Can you please guide me?
I'm sorry if it's not the best place to ask such questions.
Well, first of all this is not a trivial functionality, so I can't explain how to do that here. However we did something similar in this series: https://www.youtube.com/playlist?list=PLUBR53Dw-Ef9Wb7Wa8zn8kBu30HtsOKn8
Especially check episodes: 17, 20, 21, 22.
We are using REST API for our frontend app and authenticating users to October backend with JWT tokens.
Hope this can help you.