Ejemplo n.º 1
0
		internal override bool TryRequireSsl(out Identifier secureIdentifier) {
			// We take special care to make our wrapped identifier secure, but still
			// return a mocked (secure) identifier.
			Identifier secureWrappedIdentifier;
			bool result = this.wrappedIdentifier.TryRequireSsl(out secureWrappedIdentifier);
			secureIdentifier = new MockIdentifier(secureWrappedIdentifier, this.mockHttpRequest, this.endpoints);
			return result;
		}
Ejemplo n.º 2
0
        internal override bool TryRequireSsl(out Identifier secureIdentifier)
        {
            // We take special care to make our wrapped identifier secure, but still
            // return a mocked (secure) identifier.
            Identifier secureWrappedIdentifier;
            bool       result = this.wrappedIdentifier.TryRequireSsl(out secureWrappedIdentifier);

            secureIdentifier = new MockIdentifier(secureWrappedIdentifier, this.mockHttpRequest, this.endpoints);
            return(result);
        }
Ejemplo n.º 3
0
		protected Identifier GetMockDualIdentifier() {
			Protocol protocol = Protocol.Default;
			var opDesc = new ProviderEndpointDescription(OPUri, protocol.Version);
			var dualResults = new IdentifierDiscoveryResult[] {
				IdentifierDiscoveryResult.CreateForClaimedIdentifier(VanityUri.AbsoluteUri, OPLocalIdentifiers[0], opDesc, 10, 10),
				IdentifierDiscoveryResult.CreateForProviderIdentifier(protocol.ClaimedIdentifierForOPIdentifier, opDesc, 20, 20),
			};

			Identifier dualId = new MockIdentifier(VanityUri, this.MockResponder, dualResults);
			return dualId;
		}
		public void ProblematicClaimedId() {
			var providerEndpoint = new ProviderEndpointDescription(OpenIdTestBase.OPUri, Protocol.Default.Version);
			string claimed_id = BaseMockUri + "a./b.";
			var se = IdentifierDiscoveryResult.CreateForClaimedIdentifier(claimed_id, claimed_id, providerEndpoint, null, null);
			UriIdentifier identityUri = (UriIdentifier)se.ClaimedIdentifier;
			var mockId = new MockIdentifier(identityUri, this.MockResponder, new IdentifierDiscoveryResult[] { se });

			var positiveAssertion = this.GetPositiveAssertion();
			positiveAssertion.ClaimedIdentifier = mockId;
			positiveAssertion.LocalIdentifier = mockId;
			var rp = CreateRelyingParty();
			var authResponse = new PositiveAuthenticationResponse(positiveAssertion, rp);
			Assert.AreEqual(AuthenticationStatus.Authenticated, authResponse.Status);
			Assert.AreEqual(claimed_id, authResponse.ClaimedIdentifier.ToString());
		}