Esempio n. 1
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: "271094843065745",
                appSecret: "a2ad8653db329289da738e327fa45e32");

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



            //OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 2
0
        public static void RegisterAuth()
        {
            var fbClient = new FbClient();

            // 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: "");

            // prod
            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "262309163906980",
            //    appSecret: "3439950f4bf262d8041e28cdb1b7416c");

            // dev
            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "170633953128198",
            //    appSecret: "2a94e68adc55ff563a8c4ff178a85662");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: fbClient.AppId,
                appSecret: fbClient.AppSecret);

            OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 3
0
        public static void RegisterAuth()
        {
            //This is added to avoid multiple DBContext creation.
            WebSecurity.InitializeDatabaseConnection("DefaultConnection", "Users", "UserId", "UserName", autoCreateTables: true);
            // 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

            /*  NOTE: you MUST replace of the xxxxxxxxxxxxxxx's with a valid appId and appSecret for your application
             *  in order to be able to connect!  Also, passing the extra data is only necessary if you want to
             *  show the images for the OpenID provider.
             */

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

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

            // Google
            OAuthWebSecurity.RegisterGoogleClient();

            // Yahoo
            OAuthWebSecurity.RegisterYahooClient();

            // Microsoft Windows Live Id
            OAuthWebSecurity.RegisterMicrosoftClient(
                clientId: "xxxxxxxxxxxxxxx",
                clientSecret: "xxxxxxxxxxxxxxx");
        }
Esempio n. 4
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 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. 6
0
        public static void RegisterProviders()
        {
            var oauthConfig = OAuthConfig.Current;

            if (oauthConfig.MicrosoftEnabled)
            {
                OAuthWebSecurity.RegisterMicrosoftClient(oauthConfig.MicrosoftClientId, oauthConfig.MicrosoftClientSecret, Views.Literal_OAuth_Microsoft);
            }

            if (oauthConfig.LinkedInEnabled)
            {
                OAuthWebSecurity.RegisterLinkedInClient(oauthConfig.LinkedInConsumerKey, oauthConfig.LinkedInConsumerSecret, Views.Literal_OAuth_LinkedIn);
            }

            if (oauthConfig.TwitterEnabled)
            {
                OAuthWebSecurity.RegisterTwitterClient(oauthConfig.TwitterConsumerKey, oauthConfig.TwitterConsumerSecret, Views.Literal_OAuth_Twitter);
            }

            if (oauthConfig.FacebookEnabled)
            {
                OAuthWebSecurity.RegisterFacebookClient(oauthConfig.FacebookAppId, oauthConfig.FacebookAppSecret, Views.Literal_OAuth_Facebook);
            }

            if (oauthConfig.GoogleEnabled)
            {
                OAuthWebSecurity.RegisterGoogleClient(Views.Literal_OAuth_Google);
            }

            if (oauthConfig.YahooEnabled)
            {
                OAuthWebSecurity.RegisterYahooClient(Views.Literal_OAuth_Yahoo);
            }
        }
Esempio n. 7
0
 public static void RegisterAuth()
 {
     OAuthWebSecurity.RegisterFacebookClient(
         appId: "532581317150236",
         appSecret: "259b3d8b59bbbb77745de1c20609013a"
         );
 }
Esempio n. 8
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 msAppSecret = ConfigurationManager.AppSettings["MsAppSecret"];
            //if (!string.IsNullOrEmpty(msAppSecret))
            //{
            //    OAuthWebSecurity.RegisterMicrosoftClient(
            //        clientId: "a",
            //        clientSecret: msAppSecret);
            //}

            var twitterAppSecret = ConfigurationManager.AppSettings["TwitterAppSecret"];

            if (!string.IsNullOrEmpty(twitterAppSecret))
            {
                OAuthWebSecurity.RegisterTwitterClient(
                    consumerKey: "d6tePBz3jD7nGnk0E50Qg",
                    consumerSecret: twitterAppSecret);
            }

            var fbAppSecret = ConfigurationManager.AppSettings["FacebookAppSecret"];

            if (!string.IsNullOrEmpty(fbAppSecret))
            {
                OAuthWebSecurity.RegisterFacebookClient(
                    appId: "513621042063202",
                    appSecret: fbAppSecret);
            }

            OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 9
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);
        }
Esempio n. 10
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);
        }
Esempio n. 11
0
 public static void RegisterProvders()
 {
     OAuthWebSecurity.RegisterGoogleClient();
     OAuthWebSecurity.RegisterFacebookClient
     (
         appId: ConfigurationManager.AppSettings["FBAppID"],
         appSecret: ConfigurationManager.AppSettings["FBAppSecret"]
     );
 }
Esempio n. 12
0
 public static void RegisterProviders()
 {
     OAuthWebSecurity.RegisterGoogleClient();
     OAuthWebSecurity.RegisterFacebookClient(
         appId: "834877566554270",
         appSecret: "7192831fc3a6a4769f671902defc28ee",
         displayName: "facebook"
         );
 }
Esempio n. 13
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. 14
0
        public static void RegisterAuth()
        {
            OAuthWebSecurity.RegisterTwitterClient(
                consumerKey: "hHKbaCKOBbXdCIKr2lPA",
                consumerSecret: "mTzP3Eql4R0w7Ab9taf09kgVvxS8PoMUX0qx0q76Z4");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "556813924396028",
                appSecret: "f18ef48a28257e02adbcd69857cbd318");
        }
Esempio n. 15
0
        public static void RegisterAuth()
        {
            OAuthWebSecurity.RegisterTwitterClient(
                consumerKey: "SadlLsy0oMGIzSizAWoapK9FH",
                consumerSecret: "sAP9vqo1WQ4IMRnuZHpFoosxAeXR90xddPpAznY3tyuqY8Zcxv");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "522456357881007",
                appSecret: "2c1a55ed9eef694f811ad6975cf48eff");
        }
Esempio n. 16
0
        public static void RegisterAuth()
        {
            OAuthWebSecurity.RegisterTwitterClient(
                consumerKey: "hlCG7KZTmfkSezDG9HPUeBQYS ",
                consumerSecret: "SWANIH2WBYqo3aHLWGDWLXtKuE6Rk7rKMx5vSs8ULDCpq1XHQ4");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "969193766480070",
                appSecret: "5677cbb21ef90465696c1662d8c4df45");
        }
Esempio n. 17
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 appid     = "";
            string appsecret = "";

            //appid = WebConfigurationManager.AppSettings["FacebookAppId"].ToString();
            //appsecret = WebConfigurationManager.AppSettings["FacebookAppSecret"].ToString();

            System.Configuration.Configuration rootWebConfig1 =
                System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/");
            if (rootWebConfig1.AppSettings.Settings.Count > 0)
            {
                System.Configuration.KeyValueConfigurationElement FacebookAppSetting =
                    rootWebConfig1.AppSettings.Settings["FacebookAppId"];
                if (FacebookAppSetting != null)
                {
                    appid = FacebookAppSetting.Value;
                }

                else
                {
                    Console.WriteLine("No FacebookAppId application string");
                }

                FacebookAppSetting =
                    rootWebConfig1.AppSettings.Settings["FacebookAppSecret"];
                if (FacebookAppSetting != null)
                {
                    appsecret = FacebookAppSetting.Value;
                }

                else
                {
                    Console.WriteLine("No FacebookAppSecret application string");
                }
            }


            OAuthWebSecurity.RegisterFacebookClient(
                appId: appid,
                appSecret: appsecret);

            //OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 18
0
 private static void RegisterFBClient()
 {
     OAuthWebSecurity.RegisterFacebookClient(
         appId: "1401007186800972",
         appSecret: "b6c03f4723dcc7a484954daa8db3bb68",
         displayName: "Facebook",
         extraData: new Dictionary <string, object>()
     {
         { "iconUrl", "Images/facebook_icon.gif" }
     });
 }
Esempio n. 19
0
        public static void RegisterAuth()
        {
            GoogleOAuth2Client           clientGoog = new GoogleOAuth2Client(ConfigurationManager.AppSettings["GoogleId"], ConfigurationManager.AppSettings["GoogleKey"]);
            IDictionary <string, string> extraData  = new Dictionary <string, string>();

            OpenAuth.AuthenticationClients.Add("google", () => clientGoog, extraData);

            OAuthWebSecurity.RegisterFacebookClient(
                appId: ConfigurationManager.AppSettings["AppId"],
                appSecret: ConfigurationManager.AppSettings["AppSecret"]
                );
        }
Esempio n. 20
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);
        }
Esempio n. 21
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.RegisterFacebookClient(
                appId: "265950490105673",
                appSecret: "a7caeb3736c59684d943d776b2d519a2");

            //OAuthWebSecurity.RegisterClient(new NetflixClient("7qf3845qydavuucmhj96b6hd", "5jYe5FVhhF"));

            OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 22
0
 public static void RegisterAuth()
 {
     OAuthWebSecurity.RegisterFacebookClient(
         appId: "710642582432970",
         appSecret: "f8676402fa85d8cfdaceb7ab6af86f6e");
     OAuthWebSecurity.RegisterLinkedInClient(
         consumerKey: "86t482hcaas1vl",
         consumerSecret: "FoaMtH2nj1MQFsim"
         );
     OAuthWebSecurity.RegisterClient(
         client: new GoogleOAuth2Client(
             "1029764351833-n4mqi2u02v1439mb2f8v0df19qkl91ag.apps.googleusercontent.com", "StjvjB0OIiC6cVgk6VGZDatd"),
         displayName: "google",
         extraData: null);
 }
Esempio n. 23
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.RegisterGoogleClient();

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "343050129164564",
                appSecret: "6576a6253624845a4b40de37e63f9362");

            //    OAuthWebSecurity.RegisterTwitterClient(
            //        consumerKey: "Ao1rpYXjeTauCGwDEpg5w",
            //        consumerSecret: "ieMyxQWLap4XqJEaCeEpvR2xp1Qcg021NuJ44Forv0M");
        }
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,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            Dictionary <string, object> FacebookExtraData = new Dictionary <string, object>();

            FacebookExtraData.Add("class", "facebook-button");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: ConfigurationManager.AppSettings["appId"],
                appSecret: ConfigurationManager.AppSettings["appSecret"],
                displayName: "Facebook",
                extraData: FacebookExtraData);
        }
Esempio n. 25
0
        public static void RegisterAuth()
        {
            OAuthWebSecurity.RegisterMicrosoftClient(
                clientId: "000000004C10C01A",
                clientSecret: "NQRkZAtTHwjbsIeESF6exh02XPwshsrz");

            OAuthWebSecurity.RegisterTwitterClient(
                consumerKey: "BH2aXJW3LXxdaYpBdGzQ",
                consumerSecret: "q5fZyWwOEW9mIXVAxRd1VygY0pqUR9HiaA7cQIKZQ");
            OAuthWebSecurity.RegisterFacebookClient(
                appId: "187654464761762",
                appSecret: "62cfd93111645f7a956a0625adc3d2c5");

            OAuthWebSecurity.RegisterGoogleClient();
        }
        public void TestRegisterFacebookClient()
        {
            // Arrange
            OAuthWebSecurity.RegisterFacebookClient("one", "two", displayName: "FB", extraData: null);

            // Act
            var data = OAuthWebSecurity.RegisteredClientData;

            // Assert
            Assert.True(data.IsReadOnly);
            Assert.Equal(1, data.Count);
            Assert.Equal("facebook", data.First().AuthenticationClient.ProviderName);
            Assert.Equal("FB", data.First().DisplayName);
            Assert.Null(data.First().ExtraData);
        }
Esempio n. 27
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.RegisterTwitterClient(
                consumerKey: "YfQiIJwfNNgNP5wdrbFGQ",
                consumerSecret: "32FMF5tLWuZSncDv1gtPSvf9n9MNXoE5bTin57k88g");

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "648995925117562",
                appSecret: "e4f6bed3ceb08b673d186bc0096d1ce9");

            OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 28
0
    public static void RegisterAuth()
    {
        //OAuthWebSecurity.RegisterMicrosoftClient(
        //    clientId: "",
        //    clientSecret: "");

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

        OAuthWebSecurity.RegisterFacebookClient(
            appId: "111111111111111",
            appSecret: "a1a1aa111111111a111a111aaa111111");

        //OAuthWebSecurity.RegisterGoogleClient();
    }
        public void Execute(Castle.Windsor.IWindsorContainer container)
        {
            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

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

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "319649478165197",
                appSecret: "6e1cd15283a6598c89f7f7eb56f81735");

            OAuthWebSecurity.RegisterGoogleClient();
        }
Esempio n. 30
0
        public static void RegisterAuth()
        {
            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

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

            OAuthWebSecurity.RegisterFacebookClient(
                appId: "573370666038574",
                appSecret: "a3e1b3a2ab1129ba9cd80a35dd643e31");

            //OAuthWebSecurity.RegisterGoogleClient();
        }