예제 #1
0
        public IntuneRevocationClient(
            Dictionary <string, string> configProperties,
            TraceSource trace          = null,
            IIntuneClient intuneClient = null)
        {
            // Required Parameters
            if (configProperties == null)
            {
                throw new ArgumentNullException(nameof(configProperties));
            }

            configProperties.TryGetValue("PROVIDER_NAME_AND_VERSION", out this.providerNameAndVersion);
            if (string.IsNullOrWhiteSpace(providerNameAndVersion))
            {
                throw new ArgumentNullException(nameof(providerNameAndVersion));
            }

            // Optional Parameters
            if (trace != null)
            {
                this.trace = trace;
            }

            configProperties.TryGetValue("PkiConnectorFEServiceVersion", out this.serviceVersion);
            serviceVersion = serviceVersion ?? DEFAULT_SERVICE_VERSION;

            // Dependencies
            var msalClient = new MsalClient(
                // Required
                configProperties,
                // Overrides
                trace: trace
                );
            var adalClient = new AdalClient(
                // Required
                configProperties,
                // Overrides
                trace: trace
                );

            this.intuneClient = intuneClient ?? new IntuneClient(
                // Required
                configProperties,
                // Overrides
                trace: trace,
                // Dependencies
                authClient: msalClient,
                locationProvider: new IntuneServiceLocationProvider(
                    // Required
                    configProperties,
                    // Overrides
                    trace: trace,
                    // Dependencies
                    adalClient: adalClient,
                    msalClient: msalClient
                    )
                );
        }