On latest Discourse, provided both login required
and auth immediately
are enabled the user will be automatically logged into Discourse as long it already have a valid cookie in the Identity Provider.
On versions prior to latest, this “magic” login flow was limited to sites using our own SSO protocol, described in Official Single-Sign-On for Discourse (sso).
I’d suggest updating to latest.