# Error 401 using KafkaIO to access to schema registry

**URL:** <https://forum.confluent.io/t/error-401-using-kafkaio-to-access-to-schema-registry/4697>\
**Category:** Schema Registry\
**Created:** [5 April 2022 19:00 UTC](https://forum.confluent.io/t/error-401-using-kafkaio-to-access-to-schema-registry/4697 "2022-04-05T19:00:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imceballos](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/imceballos/32/1784_2.png) [@imceballos](https://forum.confluent.io/u/imceballos)\
**Post date:** [5 April 2022 19:00 UTC](https://forum.confluent.io/t/error-401-using-kafkaio-to-access-to-schema-registry/4697/1 "2022-04-05T19:00:33Z")

</div>

Hello, i’m trying to connect to the schema registry using KafkaIO, but i receive this error:

`io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Unauthorized; error code: 401`

```auto
props.put("schema.registry.url", "https://schema_registry_url");
props.put("basic.auth.credentials.source", "USER_INFO");
props.put("basic.auth.user.info", "KEY:PASSWORD");

   PCollection<KV<String, String>> entries =
                pipeline
                        .apply(
                                "Read Entries from Confluent Cloud Topic",
                                KafkaIO.<String, String>read()
                                        .withBootstrapServers(bootstrapserver)
                                        .withTopic(TOPIC)
                                        .withConsumerConfigUpdates(props)
                                        .withKeyDeserializer(StringDeserializer.class)
                                        .withValueDeserializer(ConfluentSchemaRegistryDeserializerProvider.of(SCHEMA_URL, TOPIC))
                                        .withoutMetadata()
                        );

```

---

<div class="post-metadata">

**Author:** ![daveklein](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/daveklein/32/140_2.png) [@daveklein](https://forum.confluent.io/u/daveklein)\
**Post date:** [6 April 2022 16:02 UTC](https://forum.confluent.io/t/error-401-using-kafkaio-to-access-to-schema-registry/4697/2 "2022-04-06T16:02:14Z")

</div>

Welcome to the forum!

Assuming that you are using “https://schema\_registry\_url”. and “KEY:PASSWORD” as placeholders for the real values, have you verified that the values you are using for key and password are the correct ones for the schema registry URL that you are trying to access?
