상속: BrockAllen.OAuth2.Provider
예제 #1
0
        public void RegisterProvider(ProviderType providerType, string clientID, string clientSecret, string scope = null, NameValueCollection additionalParameters = null)
        {
            Provider provider = null;
            switch (providerType)
            {
                case ProviderType.Google:
                    provider = new GoogleProvider(clientID, clientSecret, scope, additionalParameters);
                    break;
                case ProviderType.Live:
                    provider = new LiveProvider(clientID, clientSecret, scope, additionalParameters);
                    break;
                case ProviderType.Facebook:
                    provider = new FacebookProvider(clientID, clientSecret, scope, additionalParameters);
                    break;
                case ProviderType.LinkedIn:
                    provider = new LinkedInProvider(clientID, clientSecret, scope, additionalParameters);
                    break;
            }

            if (provider == null)
            {
                throw new ArgumentException("Invalid provider type");
            }

            providers[providerType] = provider;
        }
예제 #2
0
        public void RegisterProvider(ProviderType providerType, string clientID, string clientSecret, string scope = null)
        {
            Provider provider = null;

            switch (providerType)
            {
            case ProviderType.Google:
                provider = new GoogleProvider(clientID, clientSecret, scope);
                break;

            case ProviderType.Live:
                provider = new LiveProvider(clientID, clientSecret, scope);
                break;

            case ProviderType.Facebook:
                provider = new FacebookProvider(clientID, clientSecret, scope);
                break;

            case ProviderType.LinkedIn:
                provider = new LinkedInProvider(clientID, clientSecret, scope);
                break;
            }

            if (provider == null)
            {
                throw new ArgumentException("Invalid provider type");
            }

            providers[providerType] = provider;
        }
예제 #3
0
        public void RegisterProvider(string providerType, string clientID, string clientSecret, string scope = null)
        {
            Provider provider = null;

            switch (providerType)
            {
            case ProviderType.Google:
                provider = new GoogleProvider(clientID, clientSecret, scope);
                break;

            case ProviderType.Live:
                provider = new LiveProvider(clientID, clientSecret, scope);
                break;

            case ProviderType.Facebook:
                provider = new FacebookProvider(clientID, clientSecret, scope);
                break;

            case ProviderType.LinkedIn:
                provider = new LinkedInProvider(clientID, clientSecret, scope);
                break;
            }

            RegisterProvider(provider);
        }