HTTPContext is null while using SSO

Hi All,

I am successfully able to login with keycloak in my dotnet core application I am facing 502 bad gateway error.
Scenario : I have two application App1 and App2 If I am login in App1 I am able to login in App2 but if coming from App2 , App1 gives 502 gateway.

App1 is dotnet core razor client which is trying to get token from httpcontext but token is null. How would I update httpcontext if trying to login with SSO?