Creates the appropriate implementation of an IClaimsPrincipal based on the type of the specified IIdentity (e.g. WindowsClaimsPrincipal for a WindowsIdentity). Note the appropriate IClaimsIdentity is generated based on the specified IIdentity as well.
Namespace: Microsoft.IdentityModel.Claims
Assembly: Microsoft.IdentityModel (in microsoft.identitymodel.dll)

Usage

Visual Basic
Dim principal As IPrincipal
Dim returnValue As IClaimsPrincipal

returnValue = ClaimsPrincipal.CreateFromPrincipal(principal)

Syntax

Visual Basic
Public Shared Function CreateFromPrincipal ( _
		principal As IPrincipal _
) As IClaimsPrincipal
C#
public static IClaimsPrincipal CreateFromPrincipal (
		IPrincipal principal
)
C++
public:
static IClaimsPrincipal^ CreateFromPrincipal (
		IPrincipal^ principal
)
J#
public static IClaimsPrincipal CreateFromPrincipal (
		IPrincipal principal
)
JScript
public static function CreateFromPrincipal (
		principal : IPrincipal
) : IClaimsPrincipal

Parameters

principal

An implementation of IPrincipal.

Return Value

A claims-based principal.

Exceptions

Exception type Condition

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

See Also