So you are using wp-discourse?
You might also see Managing Discourse group membership with WP Discourse SSO
This is one section I was referring to: