public static void RegisterAuth()
        {
            string str  = ConfigurationManager.AppSettings.AsString("oauthMicrosoftClientId", null);
            string str2 = ConfigurationManager.AppSettings.AsString("oauthMicrosoftClientSecret", null);

            if (!(string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)))
            {
                OAuthWebSecurity.RegisterMicrosoftClient(str, str2);
            }
            str  = ConfigurationManager.AppSettings.AsString("oauthTwitterConsumerKey", null);
            str2 = ConfigurationManager.AppSettings.AsString("oauthTwitterConsumerSecret", null);
            if (!(string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)))
            {
                OAuthWebSecurity.RegisterTwitterClient(str, str2);
            }
            str  = ConfigurationManager.AppSettings.AsString("oauthFacebookAppId", null);
            str2 = ConfigurationManager.AppSettings.AsString("oauthFacebookAppSecret", null);
            if (!(string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)))
            {
                OAuthWebSecurity.RegisterFacebookClient(str, str2);
            }
            if (ConfigurationManager.AppSettings.AsBool("oauthGoogle", false))
            {
                OAuthWebSecurity.RegisterGoogleClient();
            }
            str  = ConfigurationManager.AppSettings.AsString("oauthVKontakteAppId", null);
            str2 = ConfigurationManager.AppSettings.AsString("oauthVKontakteAppSecret", null);
            if (!(string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)))
            {
                IAuthenticationClient client           = new VKontakteAuthenticationClient(str, str2);
                string displayName                     = "VK";
                IDictionary <string, object> extraData = null;
                OAuthWebSecurity.RegisterClient(client, displayName, extraData);
            }
        }
Esempio n. 2
0
 public static void RegisterAuth()
 {
     OAuthWebSecurity.RegisterClient(new FacebookClient(
                                         appId: ConfigurationSettings.AppSettings["facebook_appid"],
                                         appSecret: ConfigurationSettings.AppSettings["facebook_appsecret"])
                                     );
 }
Esempio n. 3
0
 public static void RegisterProviders()
 {
     // OAuthWebSecurity.RegisterGoogleClient();
     OAuthWebSecurity.RegisterClient(new GoogleCustomClient(), "Google", null);
     OAuthWebSecurity.RegisterClient(new MyFacebookClient(appId: "400271466779149", appSecret: "11df9681e7dad0b05130348f741ccbe4"), "MyFacebook", null);
     // OAuthWebSecurity.RegisterFacebookClient(appId: "400271466779149", appSecret: "11df9681e7dad0b05130348f741ccbe4");
 }
Esempio n. 4
0
        public static void RegisterAuth()
        {
            // 若要允许此站点的用户使用他们在其他站点(例如 Microsoft、Facebook 和 Twitter)上拥有的帐户登录,
            // 必须更新此站点。有关详细信息,请访问 http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "",
            //    appSecret: "");

            //OAuthWebSecurity.RegisterGoogleClient();

            OAuthWebSecurity.RegisterClient(
                new SinaClient(appId: "11111111", appSecret: "11111111"), displayName: "新浪",
                extraData: new Dictionary <string, object>
            {
                { "class", "sina" }
            });

            OAuthWebSecurity.RegisterClient(
                new QQClient(appId: "11111111", appSecret: "11111111111"), displayName: "QQ",
                extraData: new Dictionary <string, object>
            {
                { "class", "qq" }
            });
        }
Esempio n. 5
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // следует обновить сайт. Дополнительные сведения: http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "",
            //    appSecret: "");

            //OAuthWebSecurity.RegisterGoogleClient();

            OAuthWebSecurity.RegisterClient(
                client: new VKontakteAuthenticationClient(
                    "4885594", "RrqQEsLdQM8aN3GUMkYn"),
                displayName: "ВК",    // надпись на кнопке
                extraData: null);
        }
Esempio n. 6
0
        public static void RegisterAuth()
        {
            string clientId  = ConfigurationManager.AppSettings["GooglePlusClientID"].ToString();
            string secretKey = ConfigurationManager.AppSettings["GooglePlusSecretKey"].ToString();

            OAuthWebSecurity.RegisterClient(new GooglePlusUtility(clientId, secretKey), "Google+", null);
        }
        public void RequestAuthenticationRedirectsToProviderWithNullReturnUrl()
        {
            // Arrange
            var context = new Mock <HttpContextBase>();

            context.Setup(c => c.Request.ServerVariables).Returns(
                new NameValueCollection());
            context.Setup(c => c.Request.Url).Returns(new Uri("http://live.com/login.aspx"));
            context.Setup(c => c.Request.RawUrl).Returns("/login.aspx");

            var client = new Mock <IAuthenticationClient>();

            client.Setup(c => c.ProviderName).Returns("windowslive");
            client.Setup(c => c.RequestAuthentication(
                             context.Object,
                             It.Is <Uri>(u => u.AbsoluteUri.Equals("http://live.com/login.aspx?__provider__=windowslive", StringComparison.OrdinalIgnoreCase))))
            .Verifiable();

            OAuthWebSecurity.RegisterClient(client.Object);

            // Act
            OAuthWebSecurity.RequestAuthenticationCore(context.Object, "windowslive", null);

            // Assert
            client.Verify();
        }
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");


            // you will need to setup a Facebook app and enter
            // the appId and appSecret here.

            OAuthWebSecurity.RegisterClient(
                new FacebookClient(
                    appId: "509049662487356",
                    appSecret: "1b64294d0d95b1e202f8ef71fa9ab51d"),
                "Facebook", null
                );

            //OAuthWebSecurity.RegisterGoogleClient();
        }
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "",
            //    appSecret: "");

            //OAuthWebSecurity.RegisterGoogleClient();

            OAuthWebSecurity.RegisterClient(new FlickrOAuthClient("c2b9248adf2b3a90214a1c20fe1fdef6", "c1c66b0a7f1ca84d"));
            OAuthWebSecurity.RegisterClient(new GooglePlusOAuthClient("1067161712157-p1969b3q6q18v0c2anp97iarthtrmis2.apps.googleusercontent.com", "VE2aut2r8nKrmoYGGjLyrilt"));
            OAuthWebSecurity.RegisterClient(new TumblrOAuthClient("fq4O66FfwrEoXISW8xKaeGh8LOQYBHV8IBH9pPTkRPbxv8GW0M", "baHrYQazVReM0CDomuTljbo5yNA8ZvAejxovMLiMoak78AF0jk"));
            OAuthWebSecurity.RegisterClient(new TwitterOAuthClient("lFieIqoyzN6lvDqQPizYeGh2y", "WdPOrgATGvdDN1t3VZxu36EjqLfNpX4zhVAeiFJnWyI2VMRGCH"));
            OAuthWebSecurity.RegisterClient(new VkOAuthClient("4559228", "pkzqWBIXivRKrN8esLTS"));
            OAuthWebSecurity.RegisterClient(new LinkedInOAuthClient("77dcvkuxzrne0a", "3jNO4YRQxWj8Xx3B"));
            OAuthWebSecurity.RegisterClient(new InstagramOAuthClient("36342c21bc7b4a8a8ea50669d39549c8", "f2440fc49e5c49959e27fbe3410d70a5"));
            OAuthWebSecurity.RegisterClient(new FacebookOAuthClient("637656729683033", "22d9e594cbe5c77a54fbd3507ab9c879"));
        }
        public void RequestAuthenticationRedirectsToProviderWithReturnUrl()
        {
            var cookies = new HttpCookieCollection();

            // Arrange
            var context = new Mock <HttpContextBase>();

            context.Setup(c => c.Request.ServerVariables).Returns(new NameValueCollection());
            context.Setup(c => c.Request.Url).Returns(new Uri("http://live.com/login.aspx"));
            context.Setup(c => c.Request.RawUrl).Returns("/login.aspx");
            context.Setup(c => c.Response.Cookies).Returns(cookies);
            context.Setup(c => c.User.Identity.IsAuthenticated).Returns(false);

            var client = new Mock <IAuthenticationClient>();

            client.Setup(c => c.ProviderName).Returns("yahoo");
            client.Setup(c => c.RequestAuthentication(
                             context.Object,
                             It.Is <Uri>(u => u.AbsoluteUri.StartsWith("http://yahoo.com/?__provider__=yahoo", StringComparison.OrdinalIgnoreCase))))
            .Verifiable();

            OAuthWebSecurity.RegisterClient(client.Object);

            // Act
            OAuthWebSecurity.RequestAuthenticationCore(context.Object, "yahoo", "http://yahoo.com");

            // Assert
            client.Verify();
        }
Esempio n. 11
0
        public static void RegisterOAuthConfig()
        {
            EndpointConfiguration endpointConfiguration = EndpointConfiguration.GetInstance("Vistaprint/Digital/MonolithEndpoints"); //EndpointConfiguration.GetInstance("Vistaprint/Digital/OpenAuthOAuthEndpoints");
            OAuthKeyConfiguration oauthConfiguration    = OAuthKeyConfiguration.GetInstance("Vistaprint/Digital/MonolithKeys");      //OAuthKeyConfiguration.GetInstance("Vistaprint/Digital/OpenAuthOAuthKeys");

            OAuthWebSecurity.RegisterClient(new VistaprintOAuthClient(endpointConfiguration, oauthConfiguration.ConsumerKey, oauthConfiguration.ConsumerSecret));
        }
Esempio n. 12
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            // FacebooksocialData.Add("Icon", "~/Areas/UserPortal/Content/images/btn-bf-login.png");
            // FacebooksocialData.Add("scope", "email,user_birthday,publish_stream"); //new[]{ "email","user_birthday","publish_stream"}


            OAuthWebSecurity.RegisterClient(
                new FacebookScopedClient(
                    Constants.FB_APP_ID,
                    Constants.FB_APP_SECRET,
                    Constants.FB_SCOPE),
                "Facebook",
                null);

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: FB_APP_ID,
            //    appSecret: FB_APP_SECRET,
            //    displayName: "Facebook",
            //    extraData: FacebooksocialData);

            //OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 13
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            OAuthWebSecurity.RegisterClient(new TrelloClient(TrelloConfigurationManager.ApiKey, TrelloConfigurationManager.ApiSecret), "Trello", null);
        }
Esempio n. 14
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            var appSettings = ConfigurationManager.AppSettings;
            Func <string, Dictionary <string, string> > getOAuthSetting = key =>
                                                                          JsonConvert.DeserializeObject <Dictionary <string, string> >(appSettings[key]);

            var oauthMicrosoftSetting = getOAuthSetting("OAuth.Microsoft");

            OAuthWebSecurity.RegisterMicrosoftClient(
                oauthMicrosoftSetting["clientId"],
                oauthMicrosoftSetting["clientSecret"]);

            var oauthTwitterSetting = getOAuthSetting("OAuth.Twitter");

            OAuthWebSecurity.RegisterTwitterClient(
                oauthTwitterSetting["consumerKey"],
                oauthTwitterSetting["consumerSecret"]);

            var oauthFacebookSetting = getOAuthSetting("OAuth.facebook");

            OAuthWebSecurity.RegisterFacebookClient(
                oauthFacebookSetting["appId"],
                oauthFacebookSetting["appSecret"]);

            OAuthWebSecurity.RegisterGoogleClient();

            var oauthGitHubSetting = getOAuthSetting("OAuth.GitHub");

            OAuthWebSecurity.RegisterClient(new GitHubOAuth2Client(
                                                oauthGitHubSetting["clientId"],
                                                oauthGitHubSetting["clientSecret"]), "GitHub", null);
        }
        public void RegisterOAuthClient()
        {
            // Arrange
            var clients = new BuiltInOAuthClient[]
            {
                BuiltInOAuthClient.Facebook,
                BuiltInOAuthClient.Twitter,
                BuiltInOAuthClient.LinkedIn,
                BuiltInOAuthClient.WindowsLive
            };
            var clientNames = new string[]
            {
                "Facebook",
                "Twitter",
                "LinkedIn",
                "WindowsLive"
            };

            for (int i = 0; i < clients.Length; i++)
            {
                // Act
                OAuthWebSecurity.RegisterOAuthClient(clients[i], "key", "secret");

                var client = new Mock <IAuthenticationClient>();
                client.Setup(c => c.ProviderName).Returns(clientNames[i]);

                // Assert
                Assert.Throws(typeof(ArgumentException), () => OAuthWebSecurity.RegisterClient(client.Object));
            }
        }
Esempio n. 16
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            OAuthWebSecurity.RegisterTwitterClient(
                consumerKey: Credentials.Twitter.KEY,
                consumerSecret: Credentials.Twitter.SECRET);

            OAuthWebSecurity.RegisterFacebookClient(
                appId: Credentials.Facebook.KEY,
                appSecret: Credentials.Facebook.SECRET);

            OAuthWebSecurity.RegisterGoogleClient();

            OAuthWebSecurity.RegisterClient(
                new MxClient(Credentials.MxMerchant.KEY, Credentials.MxMerchant.SECRET), "MxMerchant", null);


            //OAuthWebSecurity.RegisterClient(
            //    new MxOAuth2Client(Credentials.MxMerchant.KEY, Credentials.MxMerchant.SECRET), "MxMerchant OAuth2", null);
        }
        public void RegisterOpenIDClient()
        {
            // Arrange
            var clients = new BuiltInOpenIDClient[]
            {
                BuiltInOpenIDClient.Google,
                BuiltInOpenIDClient.Yahoo
            };
            var clientNames = new string[]
            {
                "Google",
                "Yahoo"
            };

            for (int i = 0; i < clients.Length; i++)
            {
                // Act
                OAuthWebSecurity.RegisterOpenIDClient(clients[i]);

                var client = new Mock <IAuthenticationClient>();
                client.Setup(c => c.ProviderName).Returns(clientNames[i]);

                // Assert
                AssertEx.ThrowsArgument(() => OAuthWebSecurity.RegisterClient(client.Object), null);
            }
        }
Esempio n. 18
0
        public static void ConfigureAuth(IAppBuilder app)
        {
            // Sets the name of the cookie that is used by the anti-forgery system
            AntiForgeryConfig.CookieName = ResourceKeys.AntiForgeryTokenName;

            //// To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            //// you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            OAuthWebSecurity.RegisterClient(
                new OAuthFacebookClient(Settings.Default.OAuthFacebookAppId, Settings.Default.OAuthFacebookAppSecret),
                "Facebook",
                new RouteValueDictionary {
                { "logo", "i facebook" }
            });

            OAuthWebSecurity.RegisterClient(
                new OAuthGoogleClient(Settings.Default.OAuthGoogleAppId, Settings.Default.OAuthGoogleConsumerSecret),
                "Google",
                new RouteValueDictionary {
                { "logo", "i google" }
            });

            OAuthWebSecurity.RegisterClient(
                new OAuthMicrosoftClient(Settings.Default.OAuthMicrosoftAppId, Settings.Default.OAuthMicrosoftAppSecret),
                "Microsoft",
                new RouteValueDictionary {
                { "logo", "i microsoft" }
            });
        }
Esempio n. 19
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "",
            //    appSecret: "");

            //OAuthWebSecurity.RegisterGoogleClient();

            TokenRefreshCallback refreshCallback = new TokenRefreshCallback(tokenRefreshed);

            BulutfonWebClient client = new BulutfonWebClient(
                clientId: "CLIENT_ID",
                clientSecret: "CLIENT_SECRET", refreshCallback: refreshCallback);

            OAuthWebSecurity.RegisterClient(client, "Bulutfon", null);

            Token tkn = new Token("a", "b");

            tkn.RefreshCallback += tokenRefreshed;
        }
        public void VerifyAuthenticationFail()
        {
            // Arrange
            var queryStrings = new NameValueCollection();

            queryStrings.Add("__provider__", "twitter");

            var context = new Mock <HttpContextBase>();

            context.Setup(c => c.Request.QueryString).Returns(queryStrings);

            var client = new Mock <IAuthenticationClient>(MockBehavior.Strict);

            client.Setup(c => c.ProviderName).Returns("facebook");
            client.Setup(c => c.VerifyAuthentication(context.Object)).Returns(new AuthenticationResult(true, "facebook", "123",
                                                                                                       "super", null));

            var anotherClient = new Mock <IAuthenticationClient>(MockBehavior.Strict);

            anotherClient.Setup(c => c.ProviderName).Returns("twitter");
            anotherClient.Setup(c => c.VerifyAuthentication(context.Object)).Returns(AuthenticationResult.Failed);

            OAuthWebSecurity.RegisterClient(client.Object);
            OAuthWebSecurity.RegisterClient(anotherClient.Object);

            // Act
            AuthenticationResult result = OAuthWebSecurity.VerifyAuthenticationCore(context.Object, "one.aspx");

            // Assert
            Assert.False(result.IsSuccessful);
            Assert.Equal("twitter", result.Provider);
        }
Esempio n. 21
0
 public static void RegisterAuth()
 {
     OAuthWebSecurity.RegisterClient(
         new MyGoogleClient("71806529788.apps.googleusercontent.com",
                            "MKCCduYe50nZoOD0DiQJRosE",
                            "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"));
 }
Esempio n. 22
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            string FacebookAppId      = ConfigurationManager.AppSettings["FacebookAppId"];
            string FacebookAppSecret  = ConfigurationManager.AppSettings["FacebookAppSecret"];
            string GPlusClientID      = ConfigurationManager.AppSettings["GPlusClientID"];
            string GPlustClientSecret = ConfigurationManager.AppSettings["GPlustClientSecret"];

            OAuthWebSecurity.RegisterFacebookClient(
                appId: FacebookAppId,
                appSecret: FacebookAppSecret);

            OAuthWebSecurity.RegisterClient(new GooglePlusClient(GPlusClientID, GPlustClientSecret), "Google+", null);
            //OAuthWebSecurity.RegisterGoogleClient();
        }
        public void VerifyAuthenticationFailIfNoProviderInQueryString()
        {
            // Arrange
            var context = new Mock <HttpContextBase>();

            context.Setup(c => c.Request.QueryString).Returns(new NameValueCollection());

            var client = new Mock <IAuthenticationClient>(MockBehavior.Strict);

            client.Setup(c => c.ProviderName).Returns("facebook");

            var anotherClient = new Mock <IAuthenticationClient>(MockBehavior.Strict);

            anotherClient.Setup(c => c.ProviderName).Returns("twitter");

            OAuthWebSecurity.RegisterClient(client.Object);
            OAuthWebSecurity.RegisterClient(anotherClient.Object);

            // Act
            AuthenticationResult result = OAuthWebSecurity.VerifyAuthenticationCore(context.Object, "");

            // Assert
            Assert.False(result.IsSuccessful);
            Assert.Null(result.Provider);
        }
Esempio n. 24
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // следует обновить сайт. Дополнительные сведения: http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "",
            //    appSecret: "");

            //OAuthWebSecurity.RegisterGoogleClient();

            var vkAuth = new VkClient(
                AppId: "AppId",
                AppSecret: "AppSecret");

            OAuthWebSecurity.RegisterClient(vkAuth, displayName: "ВТентакле", extraData: null);

            var gitHubClient = new GitHubClient(
                clientId: "clientId",
                clientSecret: "clientSecret");

            OAuthWebSecurity.RegisterClient(gitHubClient, "GitHub", null);
        }
Esempio n. 25
0
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            // OAuthWebSecurity.RegisterFacebookClient(
            // Amovada
            //appId: "219955008083494",
            //appSecret: "92f8af70f21b76bcaf829685630326ac");

            // LEDB
            //appId: "318328708209008",
            //appSecret: "b3cfb8ffc2016c80b1ee4ec4ddac4791");

            OAuthWebSecurity.RegisterClient(
                new FacebookScopedClient(
                    "219955008083494",
                    "92f8af70f21b76bcaf829685630326ac",
                    "publish_actions, publish_stream"),
                "Facebook", null);



            //OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 26
0
 public static void RegisterAuth()
 {
     OAuthWebSecurity.RegisterClient(
         client: new VKAuthClient(
             "4551784", "eBso2kOrsWVZuYqQ8AGW"),
         displayName: "ВКонтакте",
         extraData: null);
 }
Esempio n. 27
0
        public static void RegisterOpenAuth()
        {
            OAuthWebSecurity.RegisterClient(new MicrosoftScopedClient("0000000044119886",
                                                                      "3bdr0qoxJLpfHRuBQuC4rZUmJ6wTrzSP",
                                                                      "wl.basic wl.emails"
                                                                      ), "Microsoft", null);

            OAuthWebSecurity.RegisterFacebookClient("692376860819843", "dec6dc180939f4dc8b417da4fcd1321e");
            OAuthWebSecurity.RegisterClient(new GoogleCustomClient(), "Google", null);
        }
Esempio n. 28
0
 private static void RegisterVKClient()
 {
     OAuthWebSecurity.RegisterClient(
         client: new VkClient("3948805", "1n05UUgdQBPXPNvrUBpj"),
         displayName: "ВКонтактi",
         extraData: new Dictionary <string, object>()
     {
         { "iconUrl", "Images/vkontakte_icon.gif" }
     });
 }
Esempio n. 29
0
        public static void RegisterAuth(dynamic settings, IHttpClientFactory httpClientFactory)
        {
            //// To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            //// you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            string displayName = "Canvas";
            IDictionary <string, object> extraData = new Dictionary <string, object>();

            OAuthWebSecurity.RegisterClient(
                new CanvasClient((string)settings.CanvasClientId, (string)settings.CanvasClientSecret, httpClientFactory),
                displayName,
                extraData);
        }
Esempio n. 30
0
        public static void RegisterAuth()
        {
            OAuthWebSecurity.RegisterFacebookClient(
                appId: ConfigurationManager.AppSettings["FBKey"],
                appSecret: ConfigurationManager.AppSettings["FBSecret"]);

            OAuthWebSecurity.RegisterClient(
                client: new VKAuthenticationClient(
                    ConfigurationManager.AppSettings["VkKey"],
                    ConfigurationManager.AppSettings["VkSecret"]),
                displayName: "VK",
                extraData: null);
        }