async Task <IdentityResourceMetaData> GetCoreMetaDataAsync()
        {
            if (_metadata == null)
            {
                _metadata = await _service.GetMetadataAsync();

                if (_metadata == null)
                {
                    throw new InvalidOperationException("IdentityResourceMetaData returned null");
                }
                _metadata.Validate();

                return(_metadata);
            }

            return(_metadata);
        }
        internal void Validate()
        {
            if (ClientMetaData == null)
            {
                throw new InvalidOperationException("ClientMetaData not assigned.");
            }
            ClientMetaData.Validate();

            if (IdentityResourceMetaData == null)
            {
                throw new InvalidOperationException("IdentityResourceMetaData not assigned.");
            }
            IdentityResourceMetaData.Validate();

            if (ApiResourceMetaData == null)
            {
                throw new InvalidOperationException("ApiResourceMetaData not assigned.");
            }
            ApiResourceMetaData.Validate();
        }