Ejemplo n.º 1
0
        public void TestValidateWrongId()
        {
            var provider = new ApplicationOAuthProvider("1");
            var context  = new OAuthValidateClientRedirectUriContext(new OwinContext(),
                                                                     new OAuthAuthorizationServerOptions(), "2", "/Test");

            provider.ValidateClientRedirectUri(context);
            Assert.IsFalse(context.IsValidated);
        }
Ejemplo n.º 2
0
        public void TestValidateFail3()
        {
            var provider = new ApplicationOAuthProvider("1");
            var dict     = new Dictionary <string, object>()
            {
                { "owin.RequestScheme", "http" },
                { "Host", "localhost" },
                { "owin.RequestPathBase", "/" },
                { "owin.RequestPath", "" },
                { "owin.RequestQueryString", "" },
                { "owin.RequestHeaders", new Dictionary <string, string[]>() }
            };

            var context = new OAuthValidateClientRedirectUriContext(new OwinContext(dict),
                                                                    new OAuthAuthorizationServerOptions(), "1", "");

            provider.ValidateClientRedirectUri(context);
            Assert.IsFalse(context.IsValidated);
        }