Ejemplo n.º 1
0
        Authenticator CreateAuthenticator()
        {
            var redirectUrl = $"{Request.Url.Scheme}://{Request.Url.Host}/Home/Callback";
            var config      = new RuntimeClientConfiguration
            {
                IsEnabled    = false,
                ClientId     = Config.ClientId,
                ClientSecret = Config.ClientSecret,
                RedirectUri  = redirectUrl,
                Scope        = "write,view_private"
            };
            var client = new StravaClient(new RequestFactory(), config);

            return(new Authenticator(client));
        }
Ejemplo n.º 2
0
        public static ExactOnlineClient GetClient()
        {
            if (_client == null)
            {
                var clientConfig = new RuntimeClientConfiguration()
                {
                    ClientId     = WebConfigurationManager.AppSettings["EOL_CLIENT_ID"],
                    ClientSecret = WebConfigurationManager.AppSettings["EOL_CLIENT_SECRET"],
                    RedirectUri  = WebConfigurationManager.AppSettings["EOL_REDIRECT_URL"],
                };

                _client = new ExactOnlineClient(new RequestFactory(), clientConfig);
            }

            return(_client);
        }
Ejemplo n.º 3
0
        public void GetLoginLink()
        {
            IRequestFactory      factory       = new RequestFactory();
            IClientConfiguration configuration = new RuntimeClientConfiguration
            {
                IsEnabled      = true,
                ClientId       = "MDNkZGRjYTYtMmI1OC00N2UwLThiMDctZjExNGQ0ZmZmNWZl",
                ClientSecret   = "ODY2YzIzMDMtZDllMi00NzdhLWJkOTAtOTc5YjhmMjI3NmNm",
                ClientTypeName = nameof(DashOAuthClient),
                Scope          = "user trips".Replace(" ", "%20"),
                RedirectUri    = "http://www.xhaus.com/headers",
            };
            var oauthClient  = new DashOAuthClient(factory, configuration);
            var loginLinkUri = oauthClient.GetLoginLinkUri();

            Assert.IsNotNull(loginLinkUri);
        }