Did you find a solution to this? I am facing a similar problem. I have the following components.
The problem is that everything works in the browser, am able to login and access the resource server. However, I have noticed that spring cloud gateway relies on a session id to retrieve the token before it can forward it to the resource server. I can call my resource server directly with the token and it works. However, going through the gateway, it only works if the session id is present in the headers. The other thing I noticed is that my CustomGatewayFilter is only invoked if there's a session id in the request.