Yes, that’s a way to do it.
But for me there is no the “external application” now, so I’m wondering which one is simpler
- Build an external app connect to database, and build the SSO part
- Build an discourse plugin connect to database for authentication