forked from gitter-badger/IdentityServer4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRefreshToken.cs
More file actions
80 lines (70 loc) · 2.12 KB
/
RefreshToken.cs
File metadata and controls
80 lines (70 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using System.Security.Claims;
namespace IdentityServer4.Models
{
/// <summary>
/// Models a refresh token.
/// </summary>
public class RefreshToken
{
/// <summary>
/// Gets or sets the creation time.
/// </summary>
/// <value>
/// The creation time.
/// </value>
public DateTime CreationTime { get; set; }
/// <summary>
/// Gets or sets the life time.
/// </summary>
/// <value>
/// The life time.
/// </value>
public int Lifetime { get; set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
/// <value>
/// The access token.
/// </value>
public Token AccessToken { get; set; }
/// <summary>
/// Gets or sets the original subject that requiested the token.
/// </summary>
/// <value>
/// The subject.
/// </value>
public ClaimsPrincipal Subject => IdentityServerPrincipal.FromSubjectId(SubjectId, AccessToken.Claims);
/// <summary>
/// Gets or sets the version number.
/// </summary>
/// <value>
/// The version.
/// </value>
public int Version { get; set; } = 4;
/// <summary>
/// Gets the client identifier.
/// </summary>
/// <value>
/// The client identifier.
/// </value>
public string ClientId => AccessToken.ClientId;
/// <summary>
/// Gets the subject identifier.
/// </summary>
/// <value>
/// The subject identifier.
/// </value>
public string SubjectId => AccessToken.SubjectId;
/// <summary>
/// Gets the scopes.
/// </summary>
/// <value>
/// The scopes.
/// </value>
public IEnumerable<string> Scopes => AccessToken.Scopes;
}
}