Skip to content

"I'm getting an error when calling an API in CSLA: 'The principal must be of type BusinessPrincipal, cannot be Nothing'. However, I have already marked the user identity. #4206

Discussion options

You must be logged in to vote

The data portal requires that the client and server be configured the same - either to pass the principal or not.

How you do this depends on the version of CSLA.

In CSLA 8 it is like this (in your Program.cs files on client and server):

services.AddCsla(o => o
  .Security(sec => sec.FlowSecurityPrincipalFromClient = false));

That assumes that you do not want the principal to flow from client to server. You can set both client and server to true if you do want the client principal to flow to the server via the data portal.

The default is false.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rockfordlhotka
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants