예제 #1
0
        public ClientCredentials GetDefaultCredentials([NotNull] string configName = ConfigurationNames.Default)
        {
            if (configName == null)
            {
                throw new ArgumentNullException(nameof(configName));
            }

            var storesReader  = new ConfigStoresReader(_systemEnvironment, configName);
            var defaultClient = storesReader.GetDefaultClient();

            return(defaultClient == null ? null : storesReader.GetClientCredentials(defaultClient.Id));
        }
예제 #2
0
        public ClientCredentials GetCredentialsByClientId([NotNull] string clientId, [NotNull] string configName = ConfigurationNames.Default)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException(nameof(clientId));
            }
            if (configName == null)
            {
                throw new ArgumentNullException(nameof(configName));
            }

            var storesReader = new ConfigStoresReader(_systemEnvironment, configName);
            var clientData   = storesReader.GetClientById(clientId);

            return(clientData == null ? null : storesReader.GetClientCredentials(clientData.Id));
        }