Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBRowser - Clear cache & cookies Options
ruk
Posted: Sunday, June 18, 2017 5:00:56 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 31
We are moving from CefSharp to EO. CefSharp supported impersonating engines with given user credential. This allowed us to implement the user switching requirement in our current released product. We are currently switching to EO to address some of the performance issues with CefSharp for our next release. If the WebView has to be running on a child process, this approach is not a feasible for our application since the application relies on in-process hosted controls. Is there a way adding the user context to engines can be expedited?
ruk
Posted: Wednesday, June 21, 2017 12:22:48 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 31
Wondering if you have timeframe on when we could expect the support for user context for engines. We are in a situation where our migration from CefSharp to EO hit a roadblock with this issue. Appreciate if we could get an idea of timeframe for adding this capability so that we can plan accordingly. Thank you.
eo_support
Posted: Wednesday, June 21, 2017 12:56:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
We are looking to implement this in the next two weeks. We will reply again if anything changes or when we have an update.
eo_support
Posted: Friday, June 30, 2017 4:08:01 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Hi,

This is just to let you know that we have posted a new build that supports using a different user for Windows authentication. You will need to use this method to start the engine:

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

The flow will be something like this:

Code: C#
//Create an Engine and start it with the specified windows user
EO.WebEngine.Engine engine = EO.WebEngine.Engine.Create("your_engine_name");
engine.Start(your_user);

//Create a new WebView under that Engine
WebView webView = new WebView();
webView.Engine = engine;


Now if you load a page inside the WebView, it will use the user you passed to the Engine.Start method to authenticate with the server.

Please let us know if you still have any questions.

Thanks!
ruk
Posted: Friday, June 30, 2017 5:40:13 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 31
Thank you. We are integrating the latest EO build to leverage this.

Meanwhile one question. Is the EO code takes care of disposing the WindowsIdentity passed into the Start method or the caller is responsible to dispose the WindowsIdentity after the Start call.?
eo_support
Posted: Friday, June 30, 2017 5:46:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
No. We do not dispose it. You will need to dispose it. Internally we make a copy of the user token so you can dispose it as soon as Start call is done.
santosh
Posted: Tuesday, July 4, 2017 7:12:44 AM
Rank: Newbie
Groups: Member

Joined: 7/4/2017
Posts: 2
Hi thanks for reply.
We used this solution with latest assembly. We are able to login with different user context. But when we try to start engine again with different user context without starting application, it is throwing below error.

Child process exited unexpectedly.
at EO.Internal.jm.a(Exception A_0, Boolean A_1)
at EO.Internal.jm.a(p2 A_0)
at EO.Internal.jm.a(Boolean& A_0, a9q[] A_1, String A_2, String A_3)
at EO.Internal.jm.a(a9q[] A_0, String A_1, String A_2)
at EO.Internal.ap8.a(String A_0, String A_1)
at EO.Internal.avz.c()
at EO.Internal.avz.a(WindowsIdentity A_0)
at EO.WebEngine.Engine.Start(WindowsIdentity user)
at ArchestrA.Visualization.SDK.Controls.EoEngine.StartNewEngine() in e:\TFS\ITEE\Dev\Source\SDKPublic\WebControl\EO\EoEngine.cs:line 55
at ArchestrA.Visualization.SDK.Controls.EoEngine.Restart() in e:\TFS\ITEE\Dev\Source\SDKPublic\WebControl\EO\EoEngine.cs:line 40
at ArchestrA.Visualization.SDK.Controls.WebControl.OnViewAppLogOnChanged(Object sender, EventArgs e) in e:\TFS\ITEE\Dev\Source\SDKPublic\WebControl\WebControl.cs:line 328
at ArchestrA.Client.MyViewApp.Security.RaiseLogOnUserChanged() in e:\TFS\ITEE\Dev\Source\SDKPublic\RuntimeData\Security.cs:line 149


after removing dispose related code

Child process exited unexpectedly.
at EO.Internal.jm.a(Exception A_0, Boolean A_1)
at EO.Internal.jm.a(p2 A_0)
at EO.Internal.jm.a(Boolean& A_0, a9q[] A_1, String A_2, String A_3)
at EO.Internal.jm.a(a9q[] A_0, String A_1, String A_2)
at EO.Internal.ap8.a(String A_0, String A_1)
at EO.Internal.avz.c()
at EO.Internal.avz.a(WindowsIdentity A_0)
at EO.WebEngine.Engine.Start(WindowsIdentity user)
at ArchestrA.Visualization.SDK.Controls.EoEngine.CreateEngineWithCurrentUserCredentials() in e:\TFS\ITEE\Dev\Source\SDKPublic\WebControl\EO\EoEngine.cs:line 53
at ArchestrA.Visualization.SDK.Controls.WebControl.OnViewAppLogOnChanged(Object sender, EventArgs e) in e:\TFS\ITEE\Dev\Source\SDKPublic\WebControl\WebControl.cs:line 320
at ArchestrA.Client.MyViewApp.Security.RaiseLogOnUserChanged() in e:\TFS\ITEE\Dev\Source\SDKPublic\RuntimeData\Security.cs:line 149

without user context

Child process exited unexpectedly.
at EO.Internal.jm.a(Exception A_0, Boolean A_1)
at EO.Internal.jm.a(p2 A_0)
at EO.Internal.jm.a(Boolean& A_0, a9q[] A_1, String A_2, String A_3)
at EO.Internal.jm.a(a9q[] A_0, String A_1, String A_2)
at EO.Internal.ap8.a(String A_0, String A_1)
at EO.Internal.avz.c()
at EO.Internal.avz.a(WindowsIdentity A_0)
at EO.WebEngine.Engine.Start(WindowsIdentity user)
at EO.WebEngine.Engine.Start()
at EO.Internal.avz.g()
at EO.Internal.cr..ctor(WebView A_0)
at EO.WebBrowser.WebView.x()
at EO.WebBrowser.WebView.a(IntPtr A_0, Boolean A_1)
at EO.WebBrowser.WebView.Create(IntPtr hWnd)

Is there any way we can switch between user context without re-starting application?

eo_support
Posted: Wednesday, July 5, 2017 9:41:48 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Hi,

Can you isolate the problem into a test app and then send the test app to us? You can use fake user name/password for testing purpose and we will fill into the actual username/password we use in our test environment. See here for more information on sending test project to us:

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

Thanks!
ruk
Posted: Friday, July 7, 2017 10:45:30 AM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 31
Crash is not an issue, it was an issue on our side with mismatching components. But we still have issue with WebControl not using the given user context passed to the newly created engine. We have sent an e-mail with sample project.
eo_support
Posted: Friday, July 7, 2017 4:54:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Hi,

We have looked into the test project you sent to us. Please change the argument of your LogonUser call from:

Code: C#
LogonUser(..., LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_WINNT50, ...);


To:

Code: C#
LogonUser(..., LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, ...);


The corresponding constant values are 2 (LOGON32_LOGON_INTERACTIVE) and 0 (LOGON32_PROVIDER_DEFAULT).

Please let us know if that works for you.

Thanks!
ruk
Posted: Wednesday, July 12, 2017 12:49:52 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 31
Thank you. We tried with this approach which works only when the second user logs-in. We see intermittent issues when third or fourth user logs into our app, the SharePoint still shows as the previous user. It looks like SharePoint still maintains some sort of connection info.

We found a workaround to instruct the SharePoint to change user by setting url to http://<site URL>/_layouts/closeConnection.aspx?loginasanotheruser=true. (more info can be found here: : https://www.credera.com/blog/technology-insights/microsoft-solutions/how-to-sign-in-as-a-different-user-in-sharepoint-2013/)

We are good with this approach. Thank you again for your prompt responses.
eo_support
Posted: Wednesday, July 12, 2017 2:03:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Glad to hear that you found a workaround. Thanks for sharing!


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.