コード例 #1
0
        public void OPRejectsHttpNoEncryptionAssociateRequests()
        {
            Protocol          protocol    = Protocol.V20;
            OpenIdCoordinator coordinator = new OpenIdCoordinator(
                rp => {
                // We have to formulate the associate request manually,
                // since the DNOI RP won't voluntarily suggest no encryption at all.
                var request             = new AssociateUnencryptedRequestNoSslCheck(protocol.Version, OPUri);
                request.AssociationType = protocol.Args.SignatureAlgorithm.HMAC_SHA256;
                request.SessionType     = protocol.Args.SessionType.NoEncryption;
                var response            = rp.Channel.Request <DirectErrorResponse>(request);
                Assert.IsNotNull(response);
            },
                AutoProvider);

            coordinator.Run();
        }
コード例 #2
0
        public async Task OPRejectsHttpNoEncryptionAssociateRequests()
        {
            Protocol protocol = Protocol.V20;

            this.RegisterAutoProvider();
            var rp = this.CreateRelyingParty();

            // We have to formulate the associate request manually,
            // since the DNOA RP won't voluntarily suggest no encryption at all.
            var request = new AssociateUnencryptedRequestNoSslCheck(protocol.Version, OPUri);

            request.AssociationType = protocol.Args.SignatureAlgorithm.HMAC_SHA256;
            request.SessionType     = protocol.Args.SessionType.NoEncryption;
            var response = await rp.Channel.RequestAsync <DirectErrorResponse>(request, CancellationToken.None);

            Assert.IsNotNull(response);
        }