Csla.Application.User set to UnauthenticatedPrincipal when using DataPortalProxy #2663
-
Hi, I'm in the process of converting from 4.5.601 to 5.5.2. It' WinForms, wcf, Custom CslaIdentity. The program works fine when not using the proxy. But with the proxy the Csla.Application.User is lost and set to UnauthenticatedPrincipal after first use of the dataportal. In Csla 4.5.601 it also worked when using the proxy. The reason for using a dataportal proxy is to have the ability to use multiple dataportals. Simply decorating a class like this:
App.config may look like this:
Here is the files in my CustomDataportalProxy:
Any help is appreciated. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Over time CSLA did change from defaulting to thread-local storage for current state to using AsyncLocal to store the state. This might be the source of your issue. At app startup you can switch the context manager to the older TLS implementation. This is done using the The other thing that we started changing in CSLA 5 is support for Finally, you are probably aware that WCF has no future. Microsoft stopped supporting it and it doesn't exist in modern .NET. There is an open source project to recreate WCF for modern .NET, but I haven't followed closely to see how that is coming along. Again, not your immediate problem, but in planning for the future, you should expect to switch from WCF to Http. |
Beta Was this translation helpful? Give feedback.
-
Excellent! That worked. Happy about that. Yes, will have to attend to WCF and |
Beta Was this translation helpful? Give feedback.
Over time CSLA did change from defaulting to thread-local storage for current state to using AsyncLocal to store the state. This might be the source of your issue. At app startup you can switch the context manager to the older TLS implementation. This is done using the
Csla.ApplicationContext.ContextManager
property and setting it to an instance ofCsla.Core.ApplicationContextManagerTls
.The other thing that we started changing in CSLA 5 is support for
ClaimsPrincipal
. Microsoft is phasing out our ability to use customIPrincipal
types, and it really looks like the only option going forward will be to useClaimsPrincipal
andClaimsIdentity
instances. I don't think any CSLA 5 changes to su…