Add authentication methods to access protected resources #15
23
ApiDto/Responses/TokenResponse.cs
Normal file
23
ApiDto/Responses/TokenResponse.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Mirea.Api.Dto.Responses;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a JWT and RT token.
|
||||||
|
/// </summary>
|
||||||
|
public class TokenResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A JWT token for accessing protected resources.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public required string AccessToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The date and time when the JWT token expires.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>After this date, a new JWT token must be requested.</remarks>
|
||||||
|
[Required]
|
||||||
|
public required DateTime ExpiresIn { get; set; }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user