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)); }
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); }
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); }