Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Duende.​IdentityServer.​Extensions.​PrincipalExtensions
Assembly: Duende.IdentityServer
Inheritance: object → PrincipalExtensions
Extension methods for <see cref="T:System.Security.Principal.IPrincipal" /> and <see cref="T:System.Security.Principal.IIdentity" /> .
Methods
public static
System.​DateTime
GetAuthenticationTime​(System.​Security.​Principal.​IPrincipal principal)
Gets the authentication time.
principal
The principal.
public static
long
GetAuthenticationTimeEpoch​(System.​Security.​Principal.​IPrincipal principal)
Gets the authentication epoch time.
principal
The principal.
public static
long
GetAuthenticationTimeEpoch​(System.​Security.​Principal.​IIdentity identity)
Gets the authentication epoch time.
identity
The identity.
public static
string
GetSubjectId​(System.​Security.​Principal.​IPrincipal principal)
Gets the subject identifier.
principal
The principal.
public static
string
GetSubjectId​(System.​Security.​Principal.​IIdentity identity)
Gets the subject identifier.
identity
The identity.
public static
string
GetDisplayName​(System.​Security.​Claims.​ClaimsPrincipal principal)
Gets the name.
principal
The principal.
public static
string
GetAuthenticationMethod​(System.​Security.​Principal.​IPrincipal principal)
Gets the authentication method.
principal
The principal.
public static
System.​Collections.​Generic.​IEnumerable<​System.​Security.​Claims.​Claim>
GetAuthenticationMethods​(System.​Security.​Principal.​IPrincipal principal)
Gets the authentication method claims.
principal
The principal.
public static
string
GetAuthenticationMethod​(System.​Security.​Principal.​IIdentity identity)
Gets the authentication method.
identity
The identity.
public static
System.​Collections.​Generic.​IEnumerable<​System.​Security.​Claims.​Claim>
GetAuthenticationMethods​(System.​Security.​Principal.​IIdentity identity)
Gets the authentication method claims.
identity
The identity.
public static
string
GetIdentityProvider​(System.​Security.​Principal.​IPrincipal principal)
Gets the identity provider.
principal
The principal.
public static
string
GetIdentityProvider​(System.​Security.​Principal.​IIdentity identity)
Gets the identity provider.
identity
The identity.
public static
string
GetTenant​(System.​Security.​Claims.​ClaimsPrincipal principal)
Gets the tenant.
principal
The principal.
public static
bool
IsAuthenticated​(System.​Security.​Principal.​IPrincipal principal)
Determines whether this instance is authenticated.
Returns <c>true</c> if the specified principal is authenticated; otherwise, <c>false</c> .
principal
The principal.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object