77namespace DotNetOpenAuth . Test . OpenId . RelyingParty {
88 using System ;
99 using System . Collections . Generic ;
10+ using System . Threading ;
1011 using System . Threading . Tasks ;
1112
1213 using DotNetOpenAuth . Messaging ;
@@ -31,12 +32,12 @@ public override void SetUp() {
3132 /// Verifies good, positive assertions are accepted.
3233 /// </summary>
3334 [ Test ]
34- public void Valid ( ) {
35+ public async Task Valid ( ) {
3536 PositiveAssertionResponse assertion = this . GetPositiveAssertion ( ) ;
3637 ClaimsResponse extension = new ClaimsResponse ( ) ;
3738 assertion . Extensions . Add ( extension ) ;
3839 var rp = CreateRelyingParty ( ) ;
39- var authResponse = new PositiveAuthenticationResponse ( assertion , rp ) ;
40+ var authResponse = await PositiveAuthenticationResponse . CreateAsync ( assertion , rp , CancellationToken . None ) ;
4041 Assert . AreEqual ( AuthenticationStatus . Authenticated , authResponse . Status ) ;
4142 Assert . IsNull ( authResponse . Exception ) ;
4243 Assert . AreEqual ( ( string ) assertion . ClaimedIdentifier , ( string ) authResponse . ClaimedIdentifier ) ;
@@ -51,26 +52,26 @@ public void Valid() {
5152 /// Verifies that discovery verification of a positive assertion can match a dual identifier.
5253 /// </summary>
5354 [ Test ]
54- public void DualIdentifierMatchesInAssertionVerification ( ) {
55+ public async Task DualIdentifierMatchesInAssertionVerification ( ) {
5556 PositiveAssertionResponse assertion = this . GetPositiveAssertion ( true ) ;
5657 ClaimsResponse extension = new ClaimsResponse ( ) ;
5758 assertion . Extensions . Add ( extension ) ;
5859 var rp = CreateRelyingParty ( ) ;
5960 rp . SecuritySettings . AllowDualPurposeIdentifiers = true ;
60- new PositiveAuthenticationResponse ( assertion , rp ) ; // this will throw if it fails to find a match
61+ await PositiveAuthenticationResponse . CreateAsync ( assertion , rp , CancellationToken . None ) ; // this will throw if it fails to find a match
6162 }
6263
6364 /// <summary>
6465 /// Verifies that discovery verification of a positive assertion cannot match a dual identifier
6566 /// if the default settings are in place.
6667 /// </summary>
6768 [ Test , ExpectedException ( typeof ( ProtocolException ) ) ]
68- public void DualIdentifierNoMatchInAssertionVerificationByDefault ( ) {
69+ public async Task DualIdentifierNoMatchInAssertionVerificationByDefault ( ) {
6970 PositiveAssertionResponse assertion = this . GetPositiveAssertion ( true ) ;
7071 ClaimsResponse extension = new ClaimsResponse ( ) ;
7172 assertion . Extensions . Add ( extension ) ;
7273 var rp = CreateRelyingParty ( ) ;
73- new PositiveAuthenticationResponse ( assertion , rp ) ; // this will throw if it fails to find a match
74+ await PositiveAuthenticationResponse . CreateAsync ( assertion , rp , CancellationToken . None ) ; // this will throw if it fails to find a match
7475 }
7576
7677 /// <summary>
@@ -79,11 +80,11 @@ public void DualIdentifierNoMatchInAssertionVerificationByDefault() {
7980 /// that the OP has no authority to assert positively regarding.
8081 /// </summary>
8182 [ Test , ExpectedException ( typeof ( ProtocolException ) ) ]
82- public void SpoofedClaimedIdDetectionSolicited ( ) {
83+ public async Task SpoofedClaimedIdDetectionSolicited ( ) {
8384 PositiveAssertionResponse assertion = this . GetPositiveAssertion ( ) ;
8485 assertion . ProviderEndpoint = new Uri ( "http://rogueOP" ) ;
8586 var rp = CreateRelyingParty ( ) ;
86- var authResponse = new PositiveAuthenticationResponse ( assertion , rp ) ;
87+ var authResponse = await PositiveAuthenticationResponse . CreateAsync ( assertion , rp , CancellationToken . None ) ;
8788 Assert . AreEqual ( AuthenticationStatus . Failed , authResponse . Status ) ;
8889 }
8990
@@ -92,22 +93,22 @@ public void SpoofedClaimedIdDetectionSolicited() {
9293 /// Cdentifiers when RequireSsl is set to true.
9394 /// </summary>
9495 [ Test , ExpectedException ( typeof ( ProtocolException ) ) ]
95- public void InsecureIdentifiersRejectedWithRequireSsl ( ) {
96+ public async Task InsecureIdentifiersRejectedWithRequireSsl ( ) {
9697 PositiveAssertionResponse assertion = this . GetPositiveAssertion ( ) ;
9798 var rp = CreateRelyingParty ( ) ;
9899 rp . SecuritySettings . RequireSsl = true ;
99- var authResponse = new PositiveAuthenticationResponse ( assertion , rp ) ;
100+ var authResponse = await PositiveAuthenticationResponse . CreateAsync ( assertion , rp , CancellationToken . None ) ;
100101 }
101102
102103 [ Test ]
103- public void GetCallbackArguments ( ) {
104+ public async Task GetCallbackArguments ( ) {
104105 PositiveAssertionResponse assertion = this . GetPositiveAssertion ( ) ;
105106 var rp = CreateRelyingParty ( ) ;
106107
107108 UriBuilder returnToBuilder = new UriBuilder ( assertion . ReturnTo ) ;
108109 returnToBuilder . AppendQueryArgs ( new Dictionary < string , string > { { "a" , "b" } } ) ;
109110 assertion . ReturnTo = returnToBuilder . Uri ;
110- var authResponse = new PositiveAuthenticationResponse ( assertion , rp ) ;
111+ var authResponse = await PositiveAuthenticationResponse . CreateAsync ( assertion , rp , CancellationToken . None ) ;
111112
112113 // First pretend that the return_to args were signed.
113114 assertion . ReturnToParametersSignatureValidated = true ;
@@ -137,7 +138,7 @@ public async Task ProblematicClaimedId() {
137138 var positiveAssertion = this . GetPositiveAssertion ( ) ;
138139 positiveAssertion . ClaimedIdentifier = claimed_id ;
139140 positiveAssertion . LocalIdentifier = claimed_id ;
140- var authResponse = new PositiveAuthenticationResponse ( positiveAssertion , rp ) ;
141+ var authResponse = await PositiveAuthenticationResponse . CreateAsync ( positiveAssertion , rp , CancellationToken . None ) ;
141142 Assert . AreEqual ( AuthenticationStatus . Authenticated , authResponse . Status ) ;
142143 Assert . AreEqual ( claimed_id , authResponse . ClaimedIdentifier . ToString ( ) ) ;
143144 }
0 commit comments