protected AbstractClientProvider(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) { ClientId = ccOauth.ClientId; ClientSecret = ccOauth.ClientSecret; CallBackUrl = ccOauth.CallbackUrl; Scope = ccOauth.Scope; Endpoint = ccOauth.Endpoint; AcceptedRedirectUrl = ccRoot.AcceptedRedirectUrl; FailedRedirectUrl = ccRoot.FailedRedirectUrl; Proxy = ccRoot.Proxy; }
protected AbstractClientProvider(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) { // TODO: This copying still feels wrong - config class and this client base class share data ClientId = ccOauth.ClientId; ClientSecret = ccOauth.ClientSecret; CallBackUrl = ccOauth.CallbackUrl; Scope = ccOauth.Scope; Endpoint = ccOauth.Endpoint; //AcceptedRedirectUrl = ccRoot.AcceptedRedirectUrl; FailedRedirectUrl = ccRoot.FailedRedirectUrl; Proxy = ccRoot.Proxy; }
public static T CreateClient <T>(string configName) where T : AbstractClientProvider, new() { if (String.IsNullOrEmpty(configName)) { throw new Exception("Invalid configuration name"); } var ccRoot = ConfigurationManager.GetSection("oauth2.login.configuration") as OAuthConfigurationSection; if (ccRoot != null) { var ccWebElem = ccRoot.WebConfiguration; IEnumerator configurationReader = ccRoot.OAuthVClientConfigurations.GetEnumerator(); OAuthConfigurationElement ccOauth = null; while (configurationReader.MoveNext()) { var currentOauthElement = configurationReader.Current as OAuthConfigurationElement; if (currentOauthElement != null && currentOauthElement.Name == configName) { ccOauth = currentOauthElement; break; } } if (ccOauth != null) { var constructorParams = new object[] { ccWebElem, ccOauth }; var client = (T)Activator.CreateInstance(typeof(T), constructorParams); return(client); } else { throw new Exception("ERROR: [MultiOAuthFactroy] ConfigurationName is not found!"); } } return(default(T)); }
public PayPalClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { }
public WindowsLiveClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { //ServiceType = typeof (WindowsLiveService); }
public WindowsLiveClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { }
public PayPalClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { //ServiceType = typeof (PayPalService); }
public FacebookClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { }
public TwitterClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { }
public GoogleClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { //ServiceType = typeof (GoogleService); }
public TwitterClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { //ServiceType = typeof(TwitterService); }
public FacebookClient(OAuthWebConfigurationElement ccRoot, OAuthConfigurationElement ccOauth) : base(ccRoot, ccOauth) { //ServiceType = typeof (FacebookService); }