ivandoric / Making-Websites-With-October-CMS

This is a repository for video tutorial series about making websites with October CMS. You can check out the series here: https://goo.gl/eW32CM
160 stars 52 forks source link

Extending user plugin for authentication #35

Open shahramatrian opened 4 years ago

shahramatrian commented 4 years ago

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.

ivandoric commented 4 years ago

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.