I’m developing a game and I have an in-game browser widget. I’m opening a webpage that has a login form and I want to perform seamless authentication (automatically fill it and authenticate or use an already authenticated session).
Right now I’m using IHttpRequest to handle the POST request when I do a manual login. I managed to retrieve a cookie with the session id.
Now my question is, how can I feed the information about the authenticated session to the SWebBrowser to be able to skip the login form?
Something is still missing… or maybe I’m looking at the wrong way to do it.
IWebBrowserSingleton* WebBrowserSingleton = IWebBrowserModule::Get().GetSingleton();
TSharedPtr<IWebBrowserCookieManager> CookieManager = WebBrowserSingleton->GetCookieManager();
IWebBrowserCookieManager::FCookie CookieVariable;
//Right now I'm hard coding the cookie into @CookieVariable
//I got the values from the cookie manager of mozilla with a fresh session
CookieVariable.Name = "JSESSIONID";
CookieVariable.Value = "34325DS......";
CookieVariable.bHasExpires = false;
CookieVariable.bHttpOnly = true;
CookieVariable.bSecure = false;
CookieVariable.Domain = "http://...";
CookieVariable.Path = "/**something**";
//@Response is my HttpRequest response.
CookieManager->SetCookie(Response->GetURL(), CookieVariable);
After that, I reload the page but the login form still appears…
Note: That doesn’t happen if I do a manual login and re start the game
For debugging, could you try setting this cookie from the computer’s chrome browser in incognito mode and load the page to check if it requires login. If so, your cookies are incorrect