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