Skip to content

[Bug] Basic authentication does not work when when sending requests using dubbo protocol #15630

@mitpjones

Description

@mitpjones

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

3.3.1

Steps to reproduce this issue

Basic authentication does not work when when sent requests using dubbo protocol, see also #15612 (comment)

I am using the apache-dubbo/example/dubbo-samples/1-basic/dubbo-samples-spring-boot example

After pasting

  provider:
    auth: true
    username: admin
    password: notadmin
    authenticator: basic

in to the Provider's application.yml.

If I call

curl
--header "Content-Type: application/json"
--data '["Dubbo"]'
http://localhost:50052/org.apache.dubbo.springboot.demo.DemoService/sayHello/

I get the expected

{"message":"Forbid invoke remote service interface org.apache.dubbo.springboot.demo.DemoService method sayHello() from consumer /127.0.0.1:39596 to provider 172.28.100.101","status":"401"}

However if I start the Consumer

 mvn compile exec:java -Dexec.mainClass="org.apache.dubbo.springboot.demo.consumer.ConsumerApplication"

I get

[INFO] Scanning for projects...
[INFO] 
[INFO] --------< org.apache.dubbo:dubbo-samples-spring-boot-consumer >---------
[INFO] Building dubbo-samples-spring-boot-consumer 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
.
.
.
08:52:38.069 |-INFO  [org.apache.dubbo.springboot.demo.consumer.ConsumerApplication.main()] ngboot.demo.consumer.ConsumerApplication:56  -| Started ConsumerApplication in 2.455 seconds (process running for 4.112)
Receive result ======> Hello world
08:52:38.130 |-INFO  [pool-2-thread-1] .event.AwaitingNonWebApplicationListener:179 -|  [Dubbo] Current Spring Boot Application is await...
Mon Aug 11 08:52:39 NZST 2025 Receive result ======> Hello world
Mon Aug 11 08:52:40 NZST 2025 Receive result ======> Hello world

What you expected to happen

The Dubbo consumer should be forbidden, see also #15612 (comment)

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/discussionEverything related with code discussion or question

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions