Update group membership using external database

This should be possible using WordPress as the SSO provider for Discourse. You’ll have to install and configure WordPress, and see Manage group membership in Discourse with WP Discourse SSO for the other details.