CSLA Blazor Configuration utilizing Identity Server #1719
-
I have a blazor app that I am trying to configure to use CSLA. Before adding CSLA I have the application up and running and all database calls are working, users can log in and the security is working. Following Rocky's book, I configured the app to use CSLA. Created a CustomerList, CustomerInfo, CustomerEdit, and the razor pages for viewing and editing utilizing CSLA. One the user logs in and tries to access the pages I get "Not Authorized" or "DataPortal.Fetch failed (Invalid operation - fetch not allowed)". It looks like CSLA is not seeing the User and when I added "Csla.ApplicationContext.User = httpContext.User;" into my middleware that did not help. Does anyone have any guidance on how to get this working? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
By default, CSLA takes the client-side identity and carries it to the server with each data portal call. This way the server uses the client's identity. If your user is authenticated on the server then the default is often not the best solution, and you want to tell CSLA to not carry the client identity to the server (because the server already has the identity). This is a config change on client and server. app.UseCsla(c =>
{
c.DataPortal().AuthenticationType("Windows");
}); |
Beta Was this translation helpful? Give feedback.
By default, CSLA takes the client-side identity and carries it to the server with each data portal call. This way the server uses the client's identity.
If your user is authenticated on the server then the default is often not the best solution, and you want to tell CSLA to not carry the client identity to the server (because the server already has the identity).
This is a config change on client and server.