Skip to content

Document Authentication Semantics for Public Endpoints #14122

Open
@jzheaux

Description

@jzheaux

A common question is "why do my public endpoints fail with a 401 when they are given invalid credentials?"

The answer I usually give is:

This is by design. Generally speaking, an authorization system would need to know who the user is before knowing whether the user can do X, Y, or Z operation. And even with a public endpoint, the endpoint may behave differently when a user is in context. So, in the end, they are separate systems with authentication coming first: If a request presents credentials, then the framework will try and authenticate the user and accept or deny the request accordingly.

This should be documented somewhere, including how to configure public endpoints so that they never attempt authentication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: docsAn issue in Documentation or samplestheme: documentationUse-case driven documentation with our best recommendations for how to use Spring Securitytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions