summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
index 2c7e74c..10497b2 100644
--- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs
@@ -104,6 +104,22 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
}
/// <summary>
+ /// Verifies that delegating authentication requests are filtered out when configured to do so.
+ /// </summary>
+ [TestMethod]
+ public void CreateFiltersDelegatingIdentifiers() {
+ Identifier id = GetMockIdentifier(ProtocolVersion.V20, false, true);
+ var rp = CreateRelyingParty();
+
+ // First verify that delegating identifiers work
+ Assert.IsTrue(AuthenticationRequest.Create(id, rp, realm, returnTo, false).Any(), "The delegating identifier should have not generated any results.");
+
+ // Now disable them and try again.
+ rp.SecuritySettings.RejectDelegatingIdentifiers = true;
+ Assert.IsFalse(AuthenticationRequest.Create(id, rp, realm, returnTo, false).Any(), "The delegating identifier should have not generated any results.");
+ }
+
+ /// <summary>
/// Verifies the Provider property returns non-null.
/// </summary>
[TestMethod]
@@ -144,6 +160,18 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty {
}
/// <summary>
+ /// Verifies identity-less checkid_* request behavior.
+ /// </summary>
+ [TestMethod]
+ public void NonIdentityRequest() {
+ IAuthenticationRequest_Accessor authRequest = this.CreateAuthenticationRequest(this.claimedId, this.claimedId);
+ authRequest.IsExtensionOnly = true;
+ Assert.IsTrue(authRequest.IsExtensionOnly);
+ var req = (SignedResponseRequest)authRequest.RedirectingResponse.OriginalMessage;
+ Assert.IsNotInstanceOfType(req, typeof(CheckIdRequest), "An unexpected SignedResponseRequest derived type was generated.");
+ }
+
+ /// <summary>
/// Verifies that authentication requests are generated first for OPs that respond
/// to authentication requests.
/// </summary>