TokenService Class
Assembly: PTS.Modules.IdentityTokenExtension.dll
Syntax
public class TokenService : SingleRepositoryService<Token>, IServiceProviderAccessor, ITokenService, ISeedWork<ITokenService>, ISeedWork
Inheritance
System.Object
TokenService
Constructors
TokenService(IUnitOfWork)
Declaration
public TokenService(IUnitOfWork unitOfWork)
Parameters
Methods
AddAccessToken(Identity, TokenType, TokenStatus, Nullable<DateTime>, Nullable<DateTime>)
Declaration
public virtual Token AddAccessToken(Identity identity, TokenType type, TokenStatus status = TokenStatus.NotSet, DateTime? activeFrom = default(DateTime? ), DateTime? activeUntil = default(DateTime? ))
Parameters
Type |
Name |
Description |
Identity |
identity |
|
TokenType |
type |
|
TokenStatus |
status |
|
System.Nullable<System.DateTime> |
activeFrom |
|
System.Nullable<System.DateTime> |
activeUntil |
|
Returns
AddAccessTokenAsync(Identity, TokenType, TokenStatus, Nullable<DateTime>, Nullable<DateTime>)
Declaration
public virtual Task<Token> AddAccessTokenAsync(Identity identity, TokenType type, TokenStatus status = TokenStatus.NotSet, DateTime? activeFrom = default(DateTime? ), DateTime? activeUntil = default(DateTime? ))
Parameters
Type |
Name |
Description |
Identity |
identity |
|
TokenType |
type |
|
TokenStatus |
status |
|
System.Nullable<System.DateTime> |
activeFrom |
|
System.Nullable<System.DateTime> |
activeUntil |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Token> |
|
GetAccessTokens(Identity, Nullable<TokenType>, Nullable<TokenStatus>)
Declaration
public virtual List<Token> GetAccessTokens(Identity identity, TokenType? type = default(TokenType? ), TokenStatus? status = default(TokenStatus? ))
Parameters
Returns
Type |
Description |
System.Collections.Generic.List<Token> |
|
GetAccessTokensAsync(Identity, Nullable<TokenType>, Nullable<TokenStatus>)
Declaration
public virtual Task<List<Token>> GetAccessTokensAsync(Identity identity, TokenType? type = default(TokenType? ), TokenStatus? status = default(TokenStatus? ))
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<Token>> |
|
GetActiveAccessToken(Identity, Nullable<TokenType>)
Declaration
public Token GetActiveAccessToken(Identity identity, TokenType? type = default(TokenType? ))
Parameters
Returns
GetActiveAccessTokenAsync(Identity, Nullable<TokenType>)
Declaration
public Task<Token> GetActiveAccessTokenAsync(Identity identity, TokenType? type = default(TokenType? ))
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<Token> |
|
IsTokenValid(Token)
Declaration
public virtual bool IsTokenValid(Token token)
Parameters
Type |
Name |
Description |
Token |
token |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Extension Methods