ClaimsPrincipal.Identity Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the primary claims identity associated with this claims principal.
public:
virtual property System::Security::Principal::IIdentity ^ Identity { System::Security::Principal::IIdentity ^ get(); };
public virtual System.Security.Principal.IIdentity Identity { get; }
public virtual System.Security.Principal.IIdentity? Identity { get; }
member this.Identity : System.Security.Principal.IIdentity
Public Overridable ReadOnly Property Identity As IIdentity
Property Value
The primary claims identity associated with this claims principal.
Implements
Remarks
By default, the framework prioritizes identities of type WindowsIdentity when returning the identity. The first WindowsIdentity found in the Identities collection is returned. If there is no WindowsIdentity in the collection, the first identity assignable from ClaimsIdentity is returned. If there is no ClaimsIdentity, null
is returned. If the Identities collection is empty, an ArgumentNullException is thrown.
You can change the default behavior by setting the PrimaryIdentitySelector property to specify a delegate to be called to determine the identity.
Applies to
See also
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για