Skip to content

WWW-Authenticate header is required per RFC 9110 Section 11.6.1 - #1278

Open
Chenjp wants to merge 1 commit into
apache:mainfrom
Chenjp:sslauth401_promote_header
Open

Chenjp wants to merge 1 commit into
apache:mainfrom
Chenjp:sslauth401_promote_header

Conversation

@Chenjp

@Chenjp Chenjp commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

A server generating a 401 (Unauthorized) response MUST send a WWW-Authenticate header field containing at least one challenge.

Assign header WWW-Authenticate: ClientCertificate for SSL Cert failure.

A server generating a 401 (Unauthorized) response MUST send a WWW-Authenticate header field containing at least one challenge.
@arturobernalg

Copy link
Copy Markdown
Member

I don’t think introducing a new HTTP authentication scheme is the right approach here.

CLIENT-CERT authentication takes place at the TLS layer. What is the expected client behaviour when receiving a WWW-Authenticate: ClientCertificate challenge?

RFC 9110 requires an applicable challenge, not merely a header containing an arbitrary scheme name.

@michael-o

Copy link
Copy Markdown
Member

This sounds wrong. 401 appears in this case because client auth is optional otherwise the TLS handshake would fail right way. @reschke can you help?

@Chenjp

Chenjp commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

It is a opportunity to inform client - why 401.
Not basic auth, not digest auth, nor the target resource security constraints.

@Chenjp

Chenjp commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

It is a opportunity to inform client - why 401. Not basic auth, not digest auth, nor the target resource security constraints.

or CLIENT_CERT_AUTH instead.

public interface HttpServletRequest extends ServletRequest {

    /**
     * String identifier for Basic authentication. Value "BASIC"
     */
    String BASIC_AUTH = "BASIC";
    /**
     * String identifier for Form authentication. Value "FORM"
     */
    String FORM_AUTH = "FORM";
    /**
     * String identifier for Client Certificate authentication. Value "CLIENT_CERT"
     */
    String CLIENT_CERT_AUTH = "CLIENT_CERT";
    /**
     * String identifier for Digest authentication. Value "DIGEST"
     */
    String DIGEST_AUTH = "DIGEST";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants