Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 1c7e98e

Browse files
committed
Just 37 failures.
1 parent 92c9e22 commit 1c7e98e

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
2222
[DebuggerDisplay("Status: {Status}, ClaimedIdentifier: {ClaimedIdentifier}")]
2323
internal class PositiveAuthenticationResponse : PositiveAnonymousResponse {
2424
/// <summary>
25-
/// Initializes a new instance of the <see cref="PositiveAuthenticationResponse"/> class.
25+
/// Initializes a new instance of the <see cref="PositiveAuthenticationResponse"/> class
2626
/// </summary>
2727
/// <param name="response">The positive assertion response that was just received by the Relying Party.</param>
2828
/// <param name="relyingParty">The relying party.</param>
29-
internal PositiveAuthenticationResponse(PositiveAssertionResponse response, OpenIdRelyingParty relyingParty)
29+
private PositiveAuthenticationResponse(PositiveAssertionResponse response, OpenIdRelyingParty relyingParty)
3030
: base(response) {
3131
Requires.NotNull(relyingParty, "relyingParty");
3232

src/DotNetOpenAuth.Test/OAuth/AppendixScenarios.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public async Task SpecAppendixAExample() {
7171
consumer.HostFactories = this.HostFactories;
7272
var authorizeUrl = await consumer.RequestUserAuthorizationAsync(new Uri("http://printer.example.com/request_token_ready"));
7373
Uri authorizeResponseUri;
74+
this.HostFactories.AllowAutoRedirects = false;
7475
using (var httpClient = this.HostFactories.CreateHttpClient()) {
7576
using (var response = await httpClient.GetAsync(authorizeUrl)) {
7677
Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.Redirect));

src/DotNetOpenAuth.Test/OpenId/Provider/AnonymousRequestTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task IsApprovedDeterminesReturnedMessage() {
4141
}
4242

4343
/// <summary>
44-
/// Verifies that the AuthenticationRequest method is serializable.
44+
/// Verifies that the AnonymousRequest type is serializable.
4545
/// </summary>
4646
[Test]
4747
public void Serializable() {

src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace 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

Comments
 (0)