forked from openiddict/openiddict-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpenIddictClientEvents.cs
More file actions
1863 lines (1596 loc) · 72 KB
/
OpenIddictClientEvents.cs
File metadata and controls
1863 lines (1596 loc) · 72 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Extensions.Logging;
namespace OpenIddict.Client;
public static partial class OpenIddictClientEvents
{
/// <summary>
/// Represents an abstract base class used for certain event contexts.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class BaseContext
{
/// <summary>
/// Creates a new instance of the <see cref="BaseContext"/> class.
/// </summary>
protected BaseContext(OpenIddictClientTransaction transaction)
=> Transaction = transaction ?? throw new ArgumentNullException(nameof(transaction));
/// <summary>
/// Gets the environment associated with the current request being processed.
/// </summary>
public OpenIddictClientTransaction Transaction { get; }
/// <summary>
/// Gets or sets the cancellation token that will be
/// used to determine if the operation was aborted.
/// </summary>
/// <remarks>
/// Note: for security reasons, this property shouldn't be used by event
/// handlers to abort security-sensitive operations. As such, it is
/// recommended to use this property only for user-dependent operations.
/// </remarks>
public CancellationToken CancellationToken
{
get => Transaction.CancellationToken;
set => Transaction.CancellationToken = value;
}
/// <summary>
/// Gets or sets the endpoint type that handled the request, if applicable.
/// </summary>
public OpenIddictClientEndpointType EndpointType
{
get => Transaction.EndpointType;
set => Transaction.EndpointType = value;
}
/// <summary>
/// Gets or sets the request <see cref="Uri"/> of the current transaction, if available.
/// </summary>
public Uri? RequestUri
{
get => Transaction.RequestUri;
set => Transaction.RequestUri = value;
}
/// <summary>
/// Gets or sets the base <see cref="Uri"/> of the host, if available.
/// </summary>
public Uri? BaseUri
{
get => Transaction.BaseUri;
set => Transaction.BaseUri = value;
}
/// <summary>
/// Gets the logger responsible for logging processed operations.
/// </summary>
public ILogger Logger => Transaction.Logger;
/// <summary>
/// Gets the OpenIddict client options.
/// </summary>
public OpenIddictClientOptions Options => Transaction.Options;
/// <summary>
/// Gets or sets the server configuration used for the current request.
/// </summary>
public OpenIddictConfiguration Configuration
{
get => Transaction.Configuration;
set => Transaction.Configuration = value;
}
/// <summary>
/// Gets or sets the client registration used for the current request.
/// </summary>
public OpenIddictClientRegistration Registration
{
get => Transaction.Registration;
set => Transaction.Registration = value;
}
}
/// <summary>
/// Represents an abstract base class used for certain event contexts.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class BaseRequestContext : BaseContext
{
/// <summary>
/// Creates a new instance of the <see cref="BaseRequestContext"/> class.
/// </summary>
protected BaseRequestContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
/// <summary>
/// Gets a boolean indicating whether the request was fully handled.
/// </summary>
public bool IsRequestHandled { get; private set; }
/// <summary>
/// Gets a boolean indicating whether the request processing was skipped.
/// </summary>
public bool IsRequestSkipped { get; private set; }
/// <summary>
/// Marks the request as fully handled. Once declared handled,
/// a request shouldn't be processed further by the underlying host.
/// </summary>
public void HandleRequest() => IsRequestHandled = true;
/// <summary>
/// Marks the request as skipped. Once declared skipped, a request
/// shouldn't be processed further by OpenIddict but should be allowed
/// to go through the next components in the processing pipeline
/// (if this pattern is supported by the underlying host).
/// </summary>
public void SkipRequest() => IsRequestSkipped = true;
}
/// <summary>
/// Represents an abstract base class used for certain event contexts.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class BaseExternalContext : BaseValidatingContext
{
/// <summary>
/// Creates a new instance of the <see cref="BaseRequestContext"/> class.
/// </summary>
protected BaseExternalContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
/// <summary>
/// Gets or sets the URI of the external endpoint to communicate with.
/// </summary>
public Uri? RemoteUri { get; set; }
/// <summary>
/// Gets or sets the client authentication method used
/// when communicating with the external endpoint, if applicable.
/// </summary>
public string? ClientAuthenticationMethod { get; set; }
/// <summary>
/// Gets or sets the X.509 client certificate that will be used to authenticate
/// this peer when communicating with the external endpoint, if applicable.
/// </summary>
public X509Certificate2? LocalCertificate { get; set; }
/// <summary>
/// Gets or sets the token binding method used when communicating with the external endpoint, if applicable.
/// </summary>
[Obsolete("This property is no longer used and will be removed in a future version.")]
public HashSet<string> TokenBindingMethods { get; } = new(StringComparer.Ordinal);
}
/// <summary>
/// Represents an abstract base class used for certain event contexts.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class BaseValidatingContext : BaseRequestContext
{
/// <summary>
/// Creates a new instance of the <see cref="BaseValidatingContext"/> class.
/// </summary>
protected BaseValidatingContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
/// <summary>
/// Gets a boolean indicating whether the request will be rejected.
/// </summary>
public bool IsRejected { get; protected set; }
/// <summary>
/// Gets or sets the "error" parameter returned to the client application.
/// </summary>
public string? Error { get; private set; }
/// <summary>
/// Gets or sets the "error_description" parameter returned to the client application.
/// </summary>
public string? ErrorDescription { get; private set; }
/// <summary>
/// Gets or sets the "error_uri" parameter returned to the client application.
/// </summary>
public string? ErrorUri { get; private set; }
/// <summary>
/// Rejects the request.
/// </summary>
/// <param name="error">The "error" parameter returned to the client application.</param>
/// <param name="description">The "error_description" parameter returned to the client application.</param>
/// <param name="uri">The "error_uri" parameter returned to the client application.</param>
public virtual void Reject(string? error = null, string? description = null, string? uri = null)
{
Error = error;
ErrorDescription = description;
ErrorUri = uri;
IsRejected = true;
}
}
/// <summary>
/// Represents an abstract base class used for certain event contexts.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class BaseValidatingTicketContext : BaseValidatingContext
{
/// <summary>
/// Creates a new instance of the <see cref="BaseValidatingTicketContext"/> class.
/// </summary>
protected BaseValidatingTicketContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
/// <summary>
/// Gets or sets the security principal.
/// </summary>
public ClaimsPrincipal? Principal { get; set; }
}
/// <summary>
/// Represents an event called when processing an incoming request.
/// </summary>
public sealed class ProcessRequestContext : BaseValidatingContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProcessRequestContext"/> class.
/// </summary>
public ProcessRequestContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
}
/// <summary>
/// Represents an event called when processing an errored response.
/// </summary>
public sealed class ProcessErrorContext : BaseRequestContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProcessErrorContext"/> class.
/// </summary>
public ProcessErrorContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
/// <summary>
/// Gets or sets the request, or <see langword="null"/> if it couldn't be extracted.
/// </summary>
public OpenIddictRequest? Request
{
get => Transaction.Request;
set => Transaction.Request = value;
}
/// <summary>
/// Gets or sets the response.
/// </summary>
public OpenIddictResponse Response
{
get => Transaction.Response!;
set => Transaction.Response = value;
}
/// <summary>
/// Gets or sets the error returned to the caller.
/// </summary>
public string? Error { get; set; }
/// <summary>
/// Gets or sets the error description returned to the caller.
/// </summary>
public string? ErrorDescription { get; set; }
/// <summary>
/// Gets or sets the error URI returned to the caller.
/// </summary>
public string? ErrorUri { get; set; }
/// <summary>
/// Gets the additional parameters returned to the caller.
/// </summary>
public Dictionary<string, OpenIddictParameter> Parameters { get; } = new(StringComparer.Ordinal);
}
/// <summary>
/// Represents an event called when processing an authentication operation.
/// </summary>
public sealed class ProcessAuthenticationContext : BaseValidatingContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProcessAuthenticationContext"/> class.
/// </summary>
public ProcessAuthenticationContext(OpenIddictClientTransaction transaction)
: base(transaction)
{
}
/// <summary>
/// Gets or sets the request.
/// </summary>
public OpenIddictRequest Request
{
get => Transaction.Request!;
set => Transaction.Request = value;
}
/// <summary>
/// Gets the user-defined authentication properties, if available.
/// </summary>
public Dictionary<string, string?> Properties { get; } = new(StringComparer.Ordinal);
/// <summary>
/// Gets or sets the nonce used to identify the authentication demand, if applicable.
/// </summary>
public string? Nonce { get; set; }
/// <summary>
/// Gets or sets the identifier that will be used to resolve the client registration, if applicable.
/// </summary>
public string? RegistrationId { get; set; }
/// <summary>
/// Gets or sets the issuer URI of the provider that will be
/// used to resolve the client registration, if applicable.
/// </summary>
public Uri? Issuer { get; set; }
/// <summary>
/// Gets or sets the name of the provider that will be
/// used to resolve the client registration, if applicable.
/// </summary>
public string? ProviderName { get; set; }
/// <summary>
/// Gets or sets the grant type used for the authentication demand, if applicable.
/// </summary>
public string? GrantType { get; set; }
/// <summary>
/// Gets or sets the response type used for the authentication demand, if applicable.
/// </summary>
public string? ResponseType { get; set; }
/// <summary>
/// Gets or sets the request forgery protection resolved from the user session, if applicable.
/// </summary>
public string? RequestForgeryProtection { get; set; }
/// <summary>
/// Gets the audiences that will be sent to the authorization server, if applicable.
/// </summary>
public HashSet<string> Audiences { get; } = new(StringComparer.Ordinal);
/// <summary>
/// Gets the resources that will be sent to the authorization server, if applicable.
/// </summary>
public HashSet<string> Resources { get; } = new(StringComparer.Ordinal);
/// <summary>
/// Gets the scopes that will be sent to the authorization server, if applicable.
/// </summary>
public HashSet<string> Scopes { get; } = new(StringComparer.Ordinal);
/// <summary>
/// Gets or sets the URI of the token endpoint, if applicable.
/// </summary>
public Uri? TokenEndpoint { get; set; }
/// <summary>
/// Gets or sets the client authentication method used
/// when communicating with the token endpoint, if applicable.
/// </summary>
public string? TokenEndpointClientAuthenticationMethod { get; set; }
/// <summary>
/// Gets or sets the X.509 client certificate used when
/// communicating with the token endpoint, if applicable.
/// </summary>
public X509Certificate2? TokenEndpointClientCertificate { get; set; }
/// <summary>
/// Gets or sets the token binding method used when
/// communicating with the token endpoint, if applicable.
/// </summary>
public string? TokenEndpointTokenBindingMethod { get; set; }
/// <summary>
/// Gets or sets the URI of the userinfo endpoint, if applicable.
/// </summary>
public Uri? UserInfoEndpoint { get; set; }
/// <summary>
/// Gets or sets the token binding method used when
/// communicating with the userinfo endpoint, if applicable.
/// </summary>
public string? UserInfoEndpointTokenBindingMethod { get; set; }
/// <summary>
/// Gets or sets the X.509 client certificate used when
/// communicating with the userinfo endpoint, if applicable.
/// </summary>
public X509Certificate2? UserInfoEndpointClientCertificate { get; set; }
/// <summary>
/// Gets or sets the token binding methods used when
/// communicating with the userinfo endpoint, if applicable.
/// </summary>
[Obsolete("This property is no longer used and will be removed in a future version.")]
public HashSet<string> UserInfoEndpointTokenBindingMethods { get; } = new(StringComparer.Ordinal);
/// <summary>
/// Gets or sets a boolean indicating whether the token entry associated
/// with the state token should be marked as redeemed in the database.
/// </summary>
public bool DisableStateTokenRedeeming { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a token request should be sent.
/// </summary>
public bool SendTokenRequest { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a token request should be sent.
/// </summary>
public bool SendUserInfoRequest { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an authorization
/// code should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractAuthorizationCode { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a backchannel
/// access token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractBackchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a backchannel
/// identity token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractBackchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a frontchannel
/// access token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractFrontchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a frontchannel
/// identity token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractFrontchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an issued
/// token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractIssuedToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a refresh
/// token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractRefreshToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a state
/// token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractStateToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a userinfo
/// token should be extracted from the current context.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ExtractUserInfoToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an authorization
/// code must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireAuthorizationCode { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a backchannel access
/// token must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireBackchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a backchannel identity
/// token must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireBackchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a frontchannel identity
/// token must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireFrontchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a frontchannel identity
/// token must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireFrontchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an issued token
/// must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireIssuedToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a refresh token
/// must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireRefreshToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a state token
/// must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireStateToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a userinfo token
/// must be resolved for the authentication to be considered valid.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RequireUserInfoToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the authorization
/// code extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateAuthorizationCode { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the backchannel access
/// token extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateBackchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the backchannel identity
/// token extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateBackchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the frontchannel access
/// token extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateFrontchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the frontchannel identity
/// token extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateFrontchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the issued token
/// extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateIssuedToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the refresh token
/// extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateRefreshToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the state token
/// extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateStateToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the userinfo token
/// extracted from the current context should be validated.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool ValidateUserInfoToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid authorization code
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectAuthorizationCode { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid backchannel access token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectBackchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid backchannel identity token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectBackchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid frontchannel access token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectFrontchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid frontchannel identity token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectFrontchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid issued token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectIssuedToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid refresh token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectRefreshToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid state token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectStateToken { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether an invalid userinfo token
/// will cause the authentication demand to be rejected or will be ignored.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool RejectUserInfoToken { get; set; }
/// <summary>
/// Gets or sets the actor token to send to the server, if applicable.
/// </summary>
public string? ActorToken { get; set; }
/// <summary>
/// Gets or sets the type of the actor token, if applicable.
/// </summary>
public string? ActorTokenType { get; set; }
/// <summary>
/// Gets or sets the authorization code to validate, if applicable.
/// </summary>
public string? AuthorizationCode { get; set; }
/// <summary>
/// Gets or sets the backchannel access token to validate, if applicable.
/// </summary>
public string? BackchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets the expiration date of the backchannel access token, if applicable.
/// </summary>
public DateTimeOffset? BackchannelAccessTokenExpirationDate { get; set; }
/// <summary>
/// Gets or sets the backchannel identity token to validate, if applicable.
/// </summary>
public string? BackchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets the device code to validate, if applicable.
/// </summary>
public string? DeviceCode { get; set; }
/// <summary>
/// Gets or sets the frontchannel access token to validate, if applicable.
/// </summary>
public string? FrontchannelAccessToken { get; set; }
/// <summary>
/// Gets or sets the expiration date of the frontchannel access token, if applicable.
/// </summary>
public DateTimeOffset? FrontchannelAccessTokenExpirationDate { get; set; }
/// <summary>
/// Gets or sets the frontchannel identity token to validate, if applicable.
/// </summary>
public string? FrontchannelIdentityToken { get; set; }
/// <summary>
/// Gets or sets the issued token to validate, if applicable.
/// </summary>
public string? IssuedToken { get; set; }
/// <summary>
/// Gets or sets the expiration date of the issued token, if applicable.
/// </summary>
public DateTimeOffset? IssuedTokenExpirationDate { get; set; }
/// <summary>
/// Gets or sets the type of the issued token, if applicable.
/// </summary>
public string? IssuedTokenType { get; set; }
/// <summary>
/// Gets or sets the refresh token to validate, if applicable.
/// </summary>
public string? RefreshToken { get; set; }
/// <summary>
/// Gets or sets the username to send to the server, if applicable.
/// </summary>
public string? Username { get; set; }
/// <summary>
/// Gets or sets the password to send to the server, if applicable.
/// </summary>
public string? Password { get; set; }
/// <summary>
/// Gets or sets the type of the requested token to send to the server, if applicable.
/// </summary>
public string? RequestedTokenType { get; set; }
/// <summary>
/// Gets or sets the frontchannel state token to validate, if applicable.
/// </summary>
public string? StateToken { get; set; }
/// <summary>
/// Gets or sets the subject token to send to the server, if applicable.
/// </summary>
public string? SubjectToken { get; set; }
/// <summary>
/// Gets or sets the type of the subject token, if applicable.
/// </summary>
public string? SubjectTokenType { get; set; }
/// <summary>
/// Gets or sets the userinfo token to validate, if applicable.
/// </summary>
public string? UserInfoToken { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the authorization code, if applicable.
/// </summary>
public ClaimsPrincipal? AuthorizationCodePrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the backchannel access token, if applicable.
/// </summary>
public ClaimsPrincipal? BackchannelAccessTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the backchannel identity token, if applicable.
/// </summary>
public ClaimsPrincipal? BackchannelIdentityTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the frontchannel access token, if applicable.
/// </summary>
public ClaimsPrincipal? FrontchannelAccessTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the frontchannel identity token, if applicable.
/// </summary>
public ClaimsPrincipal? FrontchannelIdentityTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the issued token, if applicable.
/// </summary>
public ClaimsPrincipal? IssuedTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the merged principal containing the claims of the other principals.
/// </summary>
public ClaimsPrincipal MergedPrincipal { get; set; } = new ClaimsPrincipal(new ClaimsIdentity());
/// <summary>
/// Gets or sets the principal extracted from the refresh token, if applicable.
/// </summary>
public ClaimsPrincipal? RefreshTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the state token, if applicable.
/// </summary>
public ClaimsPrincipal? StateTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the principal extracted from the userinfo token, if applicable.
/// </summary>
public ClaimsPrincipal? UserInfoTokenPrincipal { get; set; }
/// <summary>
/// Gets or sets the request sent to the token endpoint, if applicable.
/// </summary>
public OpenIddictRequest? TokenRequest { get; set; }
/// <summary>
/// Gets or sets the response returned by the token endpoint, if applicable.
/// </summary>
public OpenIddictResponse? TokenResponse { get; set; }
/// <summary>
/// Gets or sets the request sent to the userinfo endpoint, if applicable.
/// </summary>
public OpenIddictRequest? UserInfoRequest { get; set; }
/// <summary>
/// Gets or sets the response returned by the userinfo endpoint, if applicable.
/// </summary>
public OpenIddictResponse? UserInfoResponse { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether a client assertion
/// token should be generated (and optionally included in the request).
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool GenerateClientAssertion { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the generated client
/// assertion should be included as part of the request.
/// </summary>
/// <remarks>
/// Note: overriding the value of this property is generally not recommended.
/// </remarks>
public bool IncludeClientAssertion { get; set; }
/// <summary>
/// Gets or sets the generated client assertion, if applicable.
/// The client assertion will only be returned if
/// <see cref="IncludeClientAssertion"/> is set to <see langword="true"/>.
/// </summary>
public string? ClientAssertion { get; set; }
/// <summary>
/// Gets or sets type of the generated client assertion, if applicable.
/// The client assertion type will only be returned if
/// <see cref="IncludeClientAssertion"/> is set to <see langword="true"/>.
/// </summary>
public string? ClientAssertionType { get; set; }
/// <summary>
/// Gets or sets the principal containing the claims that will be
/// used to create the client assertion, if applicable.
/// </summary>
public ClaimsPrincipal? ClientAssertionPrincipal { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether backchannel
/// identity token nonce validation should be disabled.
/// </summary>