# Interface ITokenService

Namespace
  adas_core.Authentication.Interfaces

Assembly
  adas-core.Authentication.dll

    public interface ITokenService

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Properties

### RefreshTokenValidityInDays

    int RefreshTokenValidityInDays { get; }

#### Property Value

int

## Methods

### GetRefreshToken()

Retrieves the current refresh token used to obtain new access tokens for authentication.

    string GetRefreshToken()

#### Returns

string

  The refresh token as a string.

### GetToken(string, List<Claim>)

Retrieves a SecurityToken associated with the specified username and claims. Returns null when no matching token is found.

    SecurityToken? GetToken(string username, List<Claim> claims)

#### Parameters

`username` string

  The username used to look up the security token.

`claims` List<Claim>

  The list of claims associated with the token.

#### Returns

SecurityToken

  A SecurityToken if a matching token is found; otherwise, null.

### Serialize(SecurityToken)

Serializes the specified security token into its string representation.

    string Serialize(SecurityToken token)

#### Parameters

`token` SecurityToken

  The security token to serialize.

#### Returns

string

  A string containing the serialized form of the security token.