Welcome Guest Search | Active Topics | Sign In | Register

Problems with forms authentication Options
Sören
Posted: Monday, August 3, 2020 5:03:45 AM
Rank: Member
Groups: Member

Joined: 5/14/2020
Posts: 19
We have a problem starting an Angular application with forms authenication with the EO.WebBrowser. The normal flow in other browsers is as follows:

The browser sends a request to index.html.
The request is redirected to the login form.
The login form redirects to index.html after the login.
The browser loads the js files referenced in the index.html.

The EO.WebBrowser does not load the index.html first, but the first js file directly.
This request is redirected to the login form, which leads to an error with the js file.

I suspect the reason is that the browser control caches the index.html by mistake.
eo_support
Posted: Monday, August 3, 2020 10:25:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

We do not manage the browser engine's cache directly. It's done by the Chromium engine. So in theory if this is the problem you are seeing in EO.WebBrowser, then you will see this same problem in Google Chrome. In that case the most logical place for you to fix this issue is to either in the page or on your web server, not on the client browser.

Typically you do not run into such problem is because both index.html and the included js file will have the same cache policy. So if for whatever reason index is cached, then the js file will be cached as well. However if for whatever reason the cache is out of sync, you can either delete the cache by calling this method:

https://www.essentialobjects.com/doc/eo.webengine.engine.cleanupcachefolders_overloads.aspx

Or asks user to perform a reload so that cache will be refreshed.

Thanks!
Sören
Posted: Monday, August 10, 2020 11:40:23 AM
Rank: Member
Groups: Member

Joined: 5/14/2020
Posts: 19
After emptying the cache I have the same problem, but it shows up a bit different. Now all files are downloaded correctly on the first start and the application runs. But at the second start it comes to an error again. This time the cause is not the JS files. Instead, the Angular application executes an HTTP-Get on a JSON file and this request is forwarded to the login page. Since the login page is on a different Origin, a CORS error occurs. This is the first request ever sent to the server (tested with fiddler). Again, the index.html is not called, but a cached version is used. This behavior is not the case with any other browser (tested with Chrome, Firefox and Edge). Nevertheless, we have tried to disable the caching via various entries in the HTML header of the page. Unfortunately without success.

eo_support
Posted: Monday, August 10, 2020 2:26:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

This has to have something to do with your application. We are not aware of any issue with cache. So if you have correctly set up a no-cache policy on your web server (which are reflected by the cache related header entries sent to the client), the browser engine should not skip fetching index.html. If this continues to be a problem, please try to isolate the problem into a test project and send us the test project and we will investigate further.

The second issue you are seeing is the login. Typically form authentications are implemented through cookies. So you should use fiddler to check if indeed the cookies are property sent to the client side after successful authentication, and whether they have been attached to further request. If the authentication cookies have been correctly attached to the request but you still get an authentication error, then you should check on your server side to see if you can find out why. That should point you to the right direction as to where to look further. If for whatever the cookies are not sent to the client side, or is not reattached for further requests, then again you can send us a sample project and we will look further.

Here are the instructions on sending sample project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Sören
Posted: Wednesday, August 12, 2020 6:28:51 AM
Rank: Member
Groups: Member

Joined: 5/14/2020
Posts: 19
After I disabled the cache on the IIS for the index.htms, the problem no longer occurred. Thanks for the help.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.