asp.net web api - "Default principal object cannot be set twice" error implementing WEB API with CSLA backend -
can save of hair? :)
i'm trying create asp.net web api interface older csla (1.x/2.x era) project. testing hard coding login on every request in various ways (once in startup code, authorization request filter, inside individual route request etc etc). ways tried work once , infamous:
'default principal object cannot set twice.'
exception in businessprincipal.vb (yeah know it's old, it's released software, can't upgrade csla)
i know there issue need set httpcontext.current.user = thread.currentprincipal; due internal workings of web api , already, has not resolved issue.
i'd know if has implemented web api front end , how handled issue or pointers solution.
worst case scenario if @ least login once , keep same principal without losing implement second layer of security, woudld acceptable, barring else there way login once , not lose principal?
that businessprincipal class in code base, not in csla itself. csla.security namespace include businessprincipalbase base class businessprincipal.
classes in namespace here in github
it true can call appdomain.setprincipalpolicy 1 time, should able set thread.currentprincipal , httpcontext.current.user multiple times.
Comments
Post a Comment