I need to implement simple SSO to integrate moodle users with my site.
the required scenario is
- in my normal site I will put button saying (login using moodle like fb/google).
- this button will send user to moodle site show him login page (not the normal one I guess).
- after authenticate user on login page it will redirect him back to my actual site with token (let's say jwt or any) that represent this user and I can get user data to my website like fb login.
What is the most efficient and secure way to implement this scenario and build on it when needed.
I don't have much experience with moodle but my idea it to make simple html page that authenticate user and make a jwt token represents him then redirect it back to my normal site.
I make external plugin that takes this jwt token and get whatever info I need about this user.
what is your suggestion ?