After Facebook Auth Create JWT Token Cookie

Even though I have a JWTAuthProvider setup, if a user creates their account via the Facebook provider, the JWT cookie is never set. What is the easiest way to get this cookie created without having to post it back to the convertsessiontocookie endpoint? Can I do that via a filter, something like (couldn’t quite get this to work on first pass)?

  var session = req.GetSession();
            if (session != null && !req.Cookies.Keys.Contains("ss-tok"))
            {
                //  res.SetCookie("ss-tok", )
                ConvertSessionToTokenResponse r = this.ExecuteService(new ConvertSessionToToken() { });  // this fails as it returns something else which does have the cookie.. 
            }

You need to call /session-to-token from the Client after the OAuth redirect back to your Web App.

Shouldn’t it be possible to do this in a filter though? I mean the user has a session but no token cookie. If I check the session and there is no cookie can’t I send a request in the filter to populate the ss-tok and send it back in the response?

The AuthFilters to populate the JWT Tokens on the AuthenticateResponse are not executed on a redirect Response, just call it on the client.