'SSO sharing moodle session with react app

I'm very new in moodle, and I'm looking if there is a way to connect an external app as my react js app on moodle According to a simple SSO architecture, I think I have to share the moodle session cookie with my second app

and then I need one more external API to check on react side, on every page reload if this session still exists or not

can someone helps me pls, or is there any other way to solve this



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source