I’m not quite following the problem you are trying to solve, but you can add a query parameter to the discourse_connect_url site setting on Discourse. For example: http://localhost:1234/sso?site=foo
That query param will be preserved when Discourse redirects users to the SSO auth provider site when users login to Discourse.
For context, I think this is one possible approach for allowing a single DiscourseConnect provider site to authenticate users on multiple Discourse sites. There are more details than that required for the implementation though.
If this doesn’t solve the problem for you, maybe try explaining to us again what you are wanting to accomplish.