# Class JwtTokenService | EchoHub Documentation

# Class JwtTokenService

Namespace
  EchoHub.Server.Auth

Assembly
  EchoHub.Server.dll

    public class JwtTokenService

Inheritance
  object
  JwtTokenService

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### JwtTokenService(IConfiguration)

    public JwtTokenService(IConfiguration configuration)

#### Parameters

`configuration` IConfiguration

## Fields

### RefreshTokenLifetime

    public static readonly TimeSpan RefreshTokenLifetime

#### Field Value

TimeSpan

## Methods

### GenerateAccessToken(UserProfileDto)

    public (string Token, DateTimeOffset ExpiresAt) GenerateAccessToken(UserProfileDto profile)

#### Parameters

`profile` UserProfileDto

#### Returns

(string Token, DateTimeOffset ExpiresAt)

### GenerateAccessToken(User)

    public (string Token, DateTimeOffset ExpiresAt) GenerateAccessToken(User user)

#### Parameters

`user` User

#### Returns

(string Token, DateTimeOffset ExpiresAt)

### GenerateRefreshToken()

    public static string GenerateRefreshToken()

#### Returns

string

### HashToken(string)

    public static string HashToken(string token)

#### Parameters

`token` string

#### Returns

string