diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-24 14:46:23 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-24 14:46:23 -0700 |
commit | 1c7e98eb90c0c208d0615c10b36d9ce896cf4eaa (patch) | |
tree | 1bb69ff4a249c0283843f6ca1686ee3b650b83d1 | |
parent | 92c9e2299434d9bfa60eaee8e00ad23665060d56 (diff) | |
download | DotNetOpenAuth-1c7e98eb90c0c208d0615c10b36d9ce896cf4eaa.zip DotNetOpenAuth-1c7e98eb90c0c208d0615c10b36d9ce896cf4eaa.tar.gz DotNetOpenAuth-1c7e98eb90c0c208d0615c10b36d9ce896cf4eaa.tar.bz2 |
Just 37 failures.
4 files changed, 18 insertions, 16 deletions
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs index c40a6fb..89162ab 100644 --- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs +++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs @@ -22,11 +22,11 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { [DebuggerDisplay("Status: {Status}, ClaimedIdentifier: {ClaimedIdentifier}")] internal class PositiveAuthenticationResponse : PositiveAnonymousResponse { /// <summary> - /// Initializes a new instance of the <see cref="PositiveAuthenticationResponse"/> class. + /// Initializes a new instance of the <see cref="PositiveAuthenticationResponse"/> class /// </summary> /// <param name="response">The positive assertion response that was just received by the Relying Party.</param> /// <param name="relyingParty">The relying party.</param> - internal PositiveAuthenticationResponse(PositiveAssertionResponse response, OpenIdRelyingParty relyingParty) + private PositiveAuthenticationResponse(PositiveAssertionResponse response, OpenIdRelyingParty relyingParty) : base(response) { Requires.NotNull(relyingParty, "relyingParty"); diff --git a/src/DotNetOpenAuth.Test/OAuth/AppendixScenarios.cs b/src/DotNetOpenAuth.Test/OAuth/AppendixScenarios.cs index 0d05c5e..c7b2bfa 100644 --- a/src/DotNetOpenAuth.Test/OAuth/AppendixScenarios.cs +++ b/src/DotNetOpenAuth.Test/OAuth/AppendixScenarios.cs @@ -71,6 +71,7 @@ namespace DotNetOpenAuth.Test.OAuth { consumer.HostFactories = this.HostFactories; var authorizeUrl = await consumer.RequestUserAuthorizationAsync(new Uri("http://printer.example.com/request_token_ready")); Uri authorizeResponseUri; + this.HostFactories.AllowAutoRedirects = false; using (var httpClient = this.HostFactories.CreateHttpClient()) { using (var response = await httpClient.GetAsync(authorizeUrl)) { Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.Redirect)); diff --git a/src/DotNetOpenAuth.Test/OpenId/Provider/AnonymousRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Provider/AnonymousRequestTests.cs index ad619f7..8657910 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Provider/AnonymousRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Provider/AnonymousRequestTests.cs @@ -41,7 +41,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider { } /// <summary> - /// Verifies that the AuthenticationRequest method is serializable. + /// Verifies that the AnonymousRequest type is serializable. /// </summary> [Test] public void Serializable() { diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs index a39c425..6ce74fd 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs @@ -7,6 +7,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { using System; using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; using DotNetOpenAuth.Messaging; @@ -31,12 +32,12 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Verifies good, positive assertions are accepted. /// </summary> [Test] - public void Valid() { + public async Task Valid() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(); ClaimsResponse extension = new ClaimsResponse(); assertion.Extensions.Add(extension); var rp = CreateRelyingParty(); - var authResponse = new PositiveAuthenticationResponse(assertion, rp); + var authResponse = await PositiveAuthenticationResponse.CreateAsync(assertion, rp, CancellationToken.None); Assert.AreEqual(AuthenticationStatus.Authenticated, authResponse.Status); Assert.IsNull(authResponse.Exception); Assert.AreEqual((string)assertion.ClaimedIdentifier, (string)authResponse.ClaimedIdentifier); @@ -51,13 +52,13 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Verifies that discovery verification of a positive assertion can match a dual identifier. /// </summary> [Test] - public void DualIdentifierMatchesInAssertionVerification() { + public async Task DualIdentifierMatchesInAssertionVerification() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(true); ClaimsResponse extension = new ClaimsResponse(); assertion.Extensions.Add(extension); var rp = CreateRelyingParty(); rp.SecuritySettings.AllowDualPurposeIdentifiers = true; - new PositiveAuthenticationResponse(assertion, rp); // this will throw if it fails to find a match + await PositiveAuthenticationResponse.CreateAsync(assertion, rp, CancellationToken.None); // this will throw if it fails to find a match } /// <summary> @@ -65,12 +66,12 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// if the default settings are in place. /// </summary> [Test, ExpectedException(typeof(ProtocolException))] - public void DualIdentifierNoMatchInAssertionVerificationByDefault() { + public async Task DualIdentifierNoMatchInAssertionVerificationByDefault() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(true); ClaimsResponse extension = new ClaimsResponse(); assertion.Extensions.Add(extension); var rp = CreateRelyingParty(); - new PositiveAuthenticationResponse(assertion, rp); // this will throw if it fails to find a match + await PositiveAuthenticationResponse.CreateAsync(assertion, rp, CancellationToken.None); // this will throw if it fails to find a match } /// <summary> @@ -79,11 +80,11 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// that the OP has no authority to assert positively regarding. /// </summary> [Test, ExpectedException(typeof(ProtocolException))] - public void SpoofedClaimedIdDetectionSolicited() { + public async Task SpoofedClaimedIdDetectionSolicited() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(); assertion.ProviderEndpoint = new Uri("http://rogueOP"); var rp = CreateRelyingParty(); - var authResponse = new PositiveAuthenticationResponse(assertion, rp); + var authResponse = await PositiveAuthenticationResponse.CreateAsync(assertion, rp, CancellationToken.None); Assert.AreEqual(AuthenticationStatus.Failed, authResponse.Status); } @@ -92,22 +93,22 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Cdentifiers when RequireSsl is set to true. /// </summary> [Test, ExpectedException(typeof(ProtocolException))] - public void InsecureIdentifiersRejectedWithRequireSsl() { + public async Task InsecureIdentifiersRejectedWithRequireSsl() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(); var rp = CreateRelyingParty(); rp.SecuritySettings.RequireSsl = true; - var authResponse = new PositiveAuthenticationResponse(assertion, rp); + var authResponse = await PositiveAuthenticationResponse.CreateAsync(assertion, rp, CancellationToken.None); } [Test] - public void GetCallbackArguments() { + public async Task GetCallbackArguments() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(); var rp = CreateRelyingParty(); UriBuilder returnToBuilder = new UriBuilder(assertion.ReturnTo); returnToBuilder.AppendQueryArgs(new Dictionary<string, string> { { "a", "b" } }); assertion.ReturnTo = returnToBuilder.Uri; - var authResponse = new PositiveAuthenticationResponse(assertion, rp); + var authResponse = await PositiveAuthenticationResponse.CreateAsync(assertion, rp, CancellationToken.None); // First pretend that the return_to args were signed. assertion.ReturnToParametersSignatureValidated = true; @@ -137,7 +138,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { var positiveAssertion = this.GetPositiveAssertion(); positiveAssertion.ClaimedIdentifier = claimed_id; positiveAssertion.LocalIdentifier = claimed_id; - var authResponse = new PositiveAuthenticationResponse(positiveAssertion, rp); + var authResponse = await PositiveAuthenticationResponse.CreateAsync(positiveAssertion, rp, CancellationToken.None); Assert.AreEqual(AuthenticationStatus.Authenticated, authResponse.Status); Assert.AreEqual(claimed_id, authResponse.ClaimedIdentifier.ToString()); } |