-
-
Notifications
You must be signed in to change notification settings - Fork 6
HttpProxy Authentication Problem #935
Comments
Can you catch that exception and capture |
|
Also, what version of CSLA and what version of .NET an d what version of ASP.NET? |
Sorry, I should have included that in the original post. Thanks! |
Interesting. Version 5.1 includes code to wrap So now I'm wondering what type is your principal and your identity? The serializer is clearly hitting some principal type that contains a |
I have tried two methods with the same results. Initially, I used the PTIdentity and PTPricipal from ProjectTracker. I have also tried: var identity = NSERT.Library.Security.PTIdentity.GetPTIdentity("admin", "admin");
var baseidentity = new ClaimsIdentity(identity.AuthenticationType);
baseidentity.AddClaim(new Claim(ClaimTypes.Name, identity.Name));
if (identity.Roles != null)
foreach (var item in identity.Roles)
baseidentity.AddClaim(new Claim(ClaimTypes.Role, item));
var principal = new System.Security.Claims.ClaimsPrincipal(baseidentity);
Csla.ApplicationContext.User = principal; It is likely my lack of understanding of how claims work, but I am lost right now. |
Try looking at the BlazorCslaAuthentication sample from my Blazor book. It has the most current authentication model for modern ASP.NET and CSLA. Specifically the code in the Login page |
Will do! Thank you. James |
I apologize if this is a stupid question. I have spent several hours trying to figure this our and finally decided to ask for help. I have a Web Forms UI connecting to a .NET MVC HttpProxy. I place a call to get a list from a CSLA business object and it works great if I don't authenticate the user by setting the Csla.ApplicationContext.User (unauthenticated works). As soon as I set Csla.ApplicationContext.User to an authenticated principle (PTPricinpal from Project Tracker), the same call to retrieve the list fails with "Unable to read beyond the end of the stream." If I go local, instead of using the HttpProxy, it works fine. When I stop execution at
public static PrinterList GetPrinterList()
{
return DataPortal.Fetch();
}
and show the Csla.ApplicationContext.User, I see the user I set on the client-side.
Can someone point me in the right direction to resolve this?
Thanks!
The text was updated successfully, but these errors were encountered: