C# Class Disco.Services.Authorization.AuthorizationToken

Inheritance: IAuthorizationToken
Afficher le fichier Open project: garysharp/Disco Class Usage Examples

Méthodes publiques

Méthode Description
BuildComputerAccountToken ( User User ) : AuthorizationToken
BuildToken ( User User, IEnumerable GroupMembership ) : AuthorizationToken
Has ( bool>.Func ClaimAccessor ) : bool

Checks if token contains the claim requested.

Has ( string ClaimKey ) : bool

Checks if token contains the claim requested.

HasAll ( ) : bool

Checks if token contains all the claims requested.

HasAll ( IEnumerable ClaimKeys ) : bool

Checks if token contains all the claims requested.

HasAny ( ) : bool

Checks if token contains at least one of the claims requested.

HasAny ( IEnumerable ClaimKeys ) : bool

Checks if token contains at least one of the claims requested.

Require ( string ClaimKey ) : void

Validates the token contains the claim required. An Disco.Services.Authorization.AccessDeniedException is thrown if the requirements are not met.

RequireAll ( ) : void

Validates the token contains all the claims required. An Disco.Services.Authorization.AccessDeniedException is thrown if the requirements are not met.

RequireAny ( ) : void

Validates the token contains at least one of the claims required. An Disco.Services.Authorization.AccessDeniedException is thrown if the requirements are not met.

Private Methods

Méthode Description
BuildRequireAllMessage ( IEnumerable ClaimKeys ) : string
BuildRequireAnyMessage ( IEnumerable ClaimKeys ) : string
BuildRequireMessage ( string ClaimKey ) : string
GetRequireResource ( ) : string

Method Details

BuildComputerAccountToken() public static méthode

public static BuildComputerAccountToken ( User User ) : AuthorizationToken
User Disco.Models.Repository.User
Résultat AuthorizationToken

BuildToken() public static méthode

public static BuildToken ( User User, IEnumerable GroupMembership ) : AuthorizationToken
User Disco.Models.Repository.User
GroupMembership IEnumerable
Résultat AuthorizationToken

Has() public méthode

Checks if token contains the claim requested.
public Has ( bool>.Func ClaimAccessor ) : bool
ClaimAccessor bool>.Func A lambda which validates the tokens
Résultat bool

Has() public méthode

Checks if token contains the claim requested.
public Has ( string ClaimKey ) : bool
ClaimKey string Claim Key from
Résultat bool

HasAll() public méthode

Checks if token contains all the claims requested.
public HasAll ( ) : bool
Résultat bool

HasAll() public méthode

Checks if token contains all the claims requested.
public HasAll ( IEnumerable ClaimKeys ) : bool
ClaimKeys IEnumerable Claim Keys from
Résultat bool

HasAny() public méthode

Checks if token contains at least one of the claims requested.
public HasAny ( ) : bool
Résultat bool

HasAny() public méthode

Checks if token contains at least one of the claims requested.
public HasAny ( IEnumerable ClaimKeys ) : bool
ClaimKeys IEnumerable Claim Keys from
Résultat bool

Require() public méthode

Validates the token contains the claim required. An Disco.Services.Authorization.AccessDeniedException is thrown if the requirements are not met.
public Require ( string ClaimKey ) : void
ClaimKey string Claim Key from
Résultat void

RequireAll() public méthode

Validates the token contains all the claims required. An Disco.Services.Authorization.AccessDeniedException is thrown if the requirements are not met.
public RequireAll ( ) : void
Résultat void

RequireAny() public méthode

Validates the token contains at least one of the claims required. An Disco.Services.Authorization.AccessDeniedException is thrown if the requirements are not met.
public RequireAny ( ) : void
Résultat void