static partial void SetPublicDemoDataGoogleOAuth2()
        {
            // https://www.snip2code.com/Snippet/245686/Xamarin-Google-and-Facebook-authenticati

            /*
             *      clientId: "123456789.apps.googleusercontent.com",
             *      scope: "https://www.googleapis.com/auth/userinfo.email",
             *      authorizeUrl: new Uri ("https://accounts.google.com/o/oauth2/auth"),
             *      redirectUrl: new Uri ("http://bunchy.com/oauth2callback"),
             *      getUsernameAsync: null)
             */
            oauth2 = new Xamarin.Auth.Helpers.OAuth2()
            {
                Description = "Google OAuth2",
                OAuth_IdApplication_IdAPI_KeyAPI_IdClient_IdCustomer = "",
                OAuth2_Scope                 = "https://www.googleapis.com/auth/userinfo.email",
                OAuth_UriAuthorization       = new Uri("https://accounts.google.com/o/oauth2/auth"),
                OAuth_UriCallbackAKARedirect = new Uri("http://xamarin.com"),
                AllowCancel = true,
            };

            if (TestCases.ContainsKey(oauth2.Description))
            {
                TestCases[oauth2.Description] = oauth2;
            }
            else
            {
                TestCases.Add(oauth2.Description, oauth2);
            }

            return;
        }
        static partial void SetPublicDemoDataMicrosoftLiveOAuth2()
        {
            oauth2 = new Xamarin.Auth.Helpers.OAuth2()
            {
                Description = "Microsoft Live OAuth2",

                /*
                 * clientId: "<MyclientI>",
                 * scope: "wl.basic, wl.signin, wl.offline_access",
                 * authorizeUrl: new Uri(""https://login.live.com/oauth20_authorize.srf"),
                 * redirectUrl: new Uri("https://login.live.com/oauth20_desktop.srf"))
                 */
                OAuth_IdApplication_IdAPI_KeyAPI_IdClient_IdCustomer = "",
                OAuth2_Scope                 = "wl.basic, wl.signin, wl.offline_access",
                OAuth_UriAuthorization       = new Uri("https://login.live.com/oauth20_authorize.srf"),
                OAuth_UriCallbackAKARedirect = new Uri("http://xamarin.com"),
                AllowCancel = true,
            };

            if (TestCases.ContainsKey(oauth2.Description))
            {
                TestCases[oauth2.Description] = oauth2;
            }
            else
            {
                TestCases.Add(oauth2.Description, oauth2);
            }

            return;
        }
Example #3
0
        static partial void SetPublicDemoDataLinkedInOAuth2()
        {
            /*
             * https://www.linkedin.com/secure/developer
             * https://developer.linkedin.com/docs/oauth2
             * https://developer.linkedin.com/docs/
             * https://developer.linkedin.com/docs/signin-with-linkedin
             *
             *
             * http://forums.xamarin.com/discussion/14883/login-with-linkedin
             * https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=***"
             *
             * http://forums.xamarin.com/discussion/25457/xamarin-auth
             *
             * TODO: need testing... not quite correct
             *
             */
            oauth2 = new Xamarin.Auth.Helpers.OAuth2()
            {
                Description = "LinkedIn OAuth2",
                OAuth_IdApplication_IdAPI_KeyAPI_IdClient_IdCustomer = "",
                OAuth2_Scope           = "r_basicprofile",
                OAuth_UriAuthorization =
                    new Uri
                    (
                        "https://www.linkedin.com/uas/oauth2/authorization?response_type=code"
                        +
                        "&client_id=" + ""
                        +
                        "&scope=" + Uri.EscapeDataString("r_basicprofile")
                        +
                        "&redirect_uri=" + Uri.EscapeDataString("https://xamarin.com/")
                    ),
                OAuth_UriCallbackAKARedirect = new Uri("https://xamarin.com/"),
                AllowCancel = true,
            };

            if (TestCases.ContainsKey(oauth2.Description))
            {
                TestCases[oauth2.Description] = oauth2;
            }
            else
            {
                TestCases.Add(oauth2.Description, oauth2);
            }

            return;
        }
        static partial void SetPublicDemoDataInstagramOAuth2()
        {
            oauth2 = new Xamarin.Auth.Helpers.OAuth2()
            {
                Description = "Instagram OAuth2",
                OAuth_IdApplication_IdAPI_KeyAPI_IdClient_IdCustomer = "",
                OAuth2_Scope                 = "basic",
                OAuth_UriAuthorization       = new Uri("https://api.instagram.com/oauth/authorize/"),
                OAuth_UriCallbackAKARedirect = new Uri("http://xamarin.com"),
                AllowCancel = true,
            };

            if (TestCases.ContainsKey(oauth2.Description))
            {
                TestCases[oauth2.Description] = oauth2;
            }
            else
            {
                TestCases.Add(oauth2.Description, oauth2);
            }

            return;
        }
Example #5
0
        static partial void SetPublicDemoDataGithubOAuth2()
        {
            /// https://developer.github.com/v3/oauth/#scopes
            oauth2 = new Xamarin.Auth.Helpers.OAuth2()
            {
                Description = "Github OAuth2",
                OAuth_IdApplication_IdAPI_KeyAPI_IdClient_IdCustomer = "",
                OAuth2_Scope                 = "", // "", "user",
                OAuth_UriAuthorization       = new Uri("https://github.com/login/oauth/authorize"),
                OAuth_UriCallbackAKARedirect = new Uri("http://xamarin.com"),
                AllowCancel = true,
            };

            if (TestCases.ContainsKey(oauth2.Description))
            {
                TestCases[oauth2.Description] = oauth2;
            }
            else
            {
                TestCases.Add(oauth2.Description, oauth2);
            }

            return;
        }