|
4 | 4 | namespace SecurityService.DataTransferObjects; |
5 | 5 |
|
6 | 6 | public sealed class ApiResourceResponse { |
7 | | - [JsonProperty("name")] |
8 | | - [JsonPropertyName("name")] |
9 | 7 | public string Name { get; set; } |
10 | 8 |
|
11 | | - [JsonProperty("display_name")] |
12 | | - [JsonPropertyName("display_name")] |
13 | 9 | public string? DisplayName { get; set; } |
14 | 10 |
|
15 | | - [JsonProperty("description")] |
16 | | - [JsonPropertyName("description")] |
17 | 11 | public string? Description { get; set; } |
18 | 12 |
|
19 | | - [JsonProperty("scopes")] |
20 | | - [JsonPropertyName("scopes")] |
21 | 13 | public IReadOnlyCollection<string> Scopes { get; set; } |
22 | 14 |
|
23 | | - [JsonProperty("user_claims")] |
24 | | - [JsonPropertyName("user_claims")] |
25 | 15 | public IReadOnlyCollection<string> UserClaims { get; set; } |
26 | 16 | } |
27 | 17 |
|
28 | 18 | public sealed record ApiScopeResponse { |
29 | | - [JsonProperty("name")] |
30 | | - [JsonPropertyName("name")] |
31 | 19 | public string Name { get; set; } |
32 | 20 |
|
33 | | - [JsonProperty("display_name")] |
34 | | - [JsonPropertyName("display_name")] |
35 | 21 | public string? DisplayName { get; set; } |
36 | 22 |
|
37 | | - [JsonProperty("description")] |
38 | | - [JsonPropertyName("description")] |
39 | 23 | public string? Description { get; set; } |
40 | 24 | } |
41 | 25 |
|
42 | 26 | public sealed record ClientResponse { |
43 | | - [JsonProperty("client_id")] |
44 | | - [JsonPropertyName("client_id")] |
45 | 27 | public string ClientId { get; set; } |
46 | | - [JsonProperty("client_name")] |
47 | | - [JsonPropertyName("client_name")] |
| 28 | + |
48 | 29 | public string ClientName { get; set; } |
49 | 30 |
|
50 | | - [JsonProperty("client_description")] |
51 | | - [JsonPropertyName("client_description")] |
52 | 31 | public string? Description { get; set; } |
53 | 32 |
|
54 | | - [JsonProperty("client_uri")] |
55 | | - [JsonPropertyName("client_uri")] |
56 | 33 | public string? ClientUri { get; set; } |
57 | 34 |
|
58 | | - [JsonProperty("allowed_scopes")] |
59 | | - [JsonPropertyName("allowed_scopes")] |
60 | 35 | public IReadOnlyCollection<string> AllowedScopes { get; set; } |
61 | 36 |
|
62 | | - [JsonProperty("allowed_grant_types")] |
63 | | - [JsonPropertyName("allowed_grant_types")] |
64 | 37 | public IReadOnlyCollection<string> AllowedGrantTypes { get; set; } |
65 | 38 |
|
66 | | - [JsonProperty("client_redirect_uris")] |
67 | | - [JsonPropertyName("client_redirect_uris")] |
68 | | - public IReadOnlyCollection<string> RedirectUris { get; set; } |
| 39 | + public IReadOnlyCollection<string> ClientRedirectUris { get; set; } |
69 | 40 |
|
70 | | - [JsonProperty("client_post_logout_redirect_uris")] |
71 | | - [JsonPropertyName("client_post_logout_redirect_uris")] |
72 | | - public IReadOnlyCollection<string> PostLogoutRedirectUris { get; set; } |
| 41 | + public IReadOnlyCollection<string> ClientPostLogoutRedirectUris { get; set; } |
73 | 42 |
|
74 | | - [JsonProperty("require_consent")] |
75 | | - [JsonPropertyName("require_consent")] |
76 | 43 | public bool RequireConsent { get; set; } |
77 | 44 |
|
78 | | - [JsonProperty("allow_offline_access")] |
79 | | - [JsonPropertyName("allow_offline_access")] |
80 | 45 | public bool AllowOfflineAccess { get; set; } |
81 | 46 |
|
82 | | - [JsonProperty("client_type")] |
83 | | - [JsonPropertyName("client_type")] |
84 | 47 | public string ClientType { get; set; } |
85 | 48 | } |
86 | 49 |
|
87 | 50 | public sealed record IdentityResourceResponse |
88 | 51 | { |
89 | | - [JsonProperty("name")] |
90 | | - [JsonPropertyName("name")] |
91 | 52 | public string Name { get; set; } |
92 | 53 |
|
93 | | - [JsonProperty("display_name")] |
94 | | - [JsonPropertyName("display_name")] |
95 | 54 | public string? DisplayName { get; set; } |
96 | 55 |
|
97 | | - [JsonProperty("description")] |
98 | | - [JsonPropertyName("description")] |
99 | 56 | public string? Description { get; set; } |
100 | 57 |
|
101 | | - [JsonProperty("required")] |
102 | | - [JsonPropertyName("required")] |
103 | 58 | public bool Required { get; set; } |
104 | 59 |
|
105 | | - [JsonProperty("emphasize")] |
106 | | - [JsonPropertyName("emphasize")] |
107 | 60 | public bool Emphasize { get; set; } |
108 | 61 |
|
109 | | - [JsonProperty("show_in_discovery_document")] |
110 | | - [JsonPropertyName("show_in_discovery_document")] |
111 | 62 | public bool ShowInDiscoveryDocument { get; set; } |
112 | 63 |
|
113 | | - [JsonProperty("claims")] |
114 | | - [JsonPropertyName("claims")] |
115 | 64 | public IReadOnlyCollection<string> Claims { get; set; } |
116 | 65 | } |
117 | 66 |
|
118 | 67 |
|
119 | 68 | public sealed record RoleResponse |
120 | 69 | { |
121 | | - [JsonProperty("role_id")] |
122 | | - [JsonPropertyName("role_id")] |
123 | 70 | public String RoleId { get; set; } |
124 | | - |
125 | | - [JsonProperty("role_name")] |
126 | | - [JsonPropertyName("role_name")] |
127 | | - public string Name { get; set; } |
| 71 | + public string RoleName { get; set; } |
128 | 72 | } |
129 | 73 |
|
130 | 74 | public sealed record UserResponse { |
131 | | - [JsonProperty("user_id")] |
132 | | - [JsonPropertyName("user_id")] |
133 | 75 | public String UserId { get; set; } |
134 | 76 |
|
135 | | - [JsonProperty("user_name")] |
136 | | - [JsonPropertyName("user_name")] |
137 | 77 | public string UserName { get; set; } |
138 | 78 |
|
139 | | - [JsonProperty("email_address")] |
140 | | - [JsonPropertyName("email_address")] |
141 | 79 | public string? EmailAddress { get; set; } |
142 | 80 |
|
143 | | - [JsonProperty("phone_number")] |
144 | | - [JsonPropertyName("phone_number")] |
145 | 81 | public string? PhoneNumber { get; set; } |
146 | 82 |
|
147 | | - [JsonProperty("given_name")] |
148 | | - [JsonPropertyName("given_name")] |
149 | 83 | public string? GivenName { get; set; } |
150 | 84 |
|
151 | | - [JsonProperty("middle_name")] |
152 | | - [JsonPropertyName("middle_name")] |
153 | 85 | public string? MiddleName { get; set; } |
154 | 86 |
|
155 | | - [JsonProperty("family_name")] |
156 | | - [JsonPropertyName("family_name")] |
157 | 87 | public string? FamilyName { get; set; } |
158 | 88 |
|
159 | | - [JsonProperty("claims")] |
160 | | - [JsonPropertyName("claims")] |
161 | 89 | public IReadOnlyDictionary<string, string> Claims{ get; set; } |
162 | 90 |
|
163 | | - [JsonProperty("roles")] |
164 | | - [JsonPropertyName("roles")] |
165 | 91 | public IReadOnlyCollection<string> Roles { get; set; } |
166 | 92 |
|
167 | | - [JsonProperty("registration_date_time")] |
168 | | - [JsonPropertyName("registration_date_time")] |
169 | 93 | public DateTime RegistrationDateTime { get; set; } |
170 | 94 | } |
171 | 95 |
|
172 | 96 | public class TokenResponse |
173 | 97 | { |
174 | | - /// <summary> |
175 | | - /// The access token |
176 | | - /// </summary> |
177 | | - /// <value>The access token.</value> |
178 | 98 | public String AccessToken { get; private set; } |
179 | | - |
180 | | - /// <summary> |
181 | | - /// Gets the expires. |
182 | | - /// </summary> |
183 | | - /// <value>The expires.</value> |
184 | 99 | public DateTimeOffset Expires { get; private set; } |
185 | | - |
186 | | - /// <summary> |
187 | | - /// The expires |
188 | | - /// </summary> |
189 | | - /// <value>The expires in.</value> |
190 | 100 | public Int64 ExpiresIn { get; private set; } |
191 | | - |
192 | | - /// <summary> |
193 | | - /// Gets the issued. |
194 | | - /// </summary> |
195 | | - /// <value>The issued.</value> |
196 | 101 | public DateTimeOffset Issued { get; private set; } |
197 | | - |
198 | | - /// <summary> |
199 | | - /// The refresh token |
200 | | - /// </summary> |
201 | | - /// <value>The refresh token.</value> |
202 | 102 | public String RefreshToken { get; private set; } |
203 | | - |
204 | 103 | public static TokenResponse Create(String token) |
205 | 104 | { |
206 | 105 | dynamic auth = JsonConvert.DeserializeObject(token); |
|
0 commit comments