Show / Hide Table of Contents

Class ClaimsExtensions

Inheritance
object
ClaimsExtensions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Security.Claims
Assembly: SuperOffice.Plugins.dll
Syntax
public static class ClaimsExtensions

Methods

GetClaimValue(IEnumerable<Claim>, string, string)

Get first matching claim value with provided type that has a value.

Declaration
public static string GetClaimValue(this IEnumerable<Claim> claims, string claimType, string defaultValue = null)
Parameters
Type Name Description
IEnumerable<Claim> claims
string claimType
string defaultValue

Default value to return if no values are found

Returns
Type Description
string

GetClaimValues(IEnumerable<Claim>, string)

Declaration
public static IEnumerable<string> GetClaimValues(this IEnumerable<Claim> claims, string claimType)
Parameters
Type Name Description
IEnumerable<Claim> claims
string claimType
Returns
Type Description
IEnumerable<string>

TryGetDateTimeValue(IEnumerable<Claim>, string, out DateTime)

Try get a DateTime claim value. Claim must be of type DateTime. Resolves first if there are several.

Declaration
public static bool TryGetDateTimeValue(this IEnumerable<Claim> claims, string claimType, out DateTime claimValue)
Parameters
Type Name Description
IEnumerable<Claim> claims
string claimType
DateTime claimValue
Returns
Type Description
bool

TryGetInt32Value(IEnumerable<Claim>, string, out int)

Try get int32 claim value. Claim must be of type Integer32. Resolves first if there are several.

Declaration
public static bool TryGetInt32Value(this IEnumerable<Claim> claims, string claimType, out int claimValue)
Parameters
Type Name Description
IEnumerable<Claim> claims
string claimType
int claimValue
Returns
Type Description
bool

TryGetValue(IEnumerable<Claim>, string, out string)

Try get a claim value. Resolves first if there are several.

Declaration
public static bool TryGetValue(this IEnumerable<Claim> claims, string claimType, out string claimValue)
Parameters
Type Name Description
IEnumerable<Claim> claims
string claimType
string claimValue
Returns
Type Description
bool
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top