What is the idea behind IIdentity and IPrincipal in .NET

前端 未结 4 1506
清歌不尽
清歌不尽 2021-01-30 16:23

So, what is the purpose for existence of both IIdentity and IPrincipal, and not some IIdentityMergedWithPrincipal? When is it not enough t

4条回答
  •  失恋的感觉
    2021-01-30 16:45

    As MSDN site says:

    The identity object encapsulates information about the user or entity being validated. At their most basic level, identity objects contain a name and an authentication type.

    whereas

    The principal object represents the security context under which code is running.

    Refer to the above link for a lot more info.

    HTH

提交回复
热议问题