Remove unused and insecure basic_auth (Resource Owner Password Credentials Grant)

First of all basic auth is currently not used by any endpoint so I don't think this would be a breaking change.

It's against RFC 9700 Best Current Practice for OAuth 2.0 Security:

2.4. Resource Owner Password Credentials Grant

The resource owner password credentials grant [RFC6749] MUST NOT be used. This grant type insecurely exposes the credentials of the resource owner to the client. Even if the client is benign, usage of this grant results in an increased attack surface (i.e., credentials can leak in more places than just the authorization server) and in training users to enter their credentials in places other than the authorization server.

Furthermore, the resource owner password credentials grant is not designed to work with two-factor authentication and authentication processes that require multiple user interaction steps. Authentication with cryptographic credentials (cf. WebCrypto [W3C.WebCrypto], WebAuthn [W3C.WebAuthn]) may be impossible to implement with this grant type, as it is usually bound to a specific web origin.

Also according to Securing Applications and Services Guide from keycloak:

Resource Owner Password Credentials, referred to as Direct Grant in Keycloak, allows exchanging user credentials for tokens. Per current OAuth 2.0 Security Best Practices, this flow should not be used, preferring alternative methods such as Device Authorization Grant or Authorization code.

The limitations of using this flow include:

User credentials are exposed to the application

Applications need login pages

Application needs to be aware of the authentication scheme

Changes to authentication flow requires changes to application

No support for identity brokering or social login

Flows are not supported (user self-registration, required actions, and so on.)

Security concerns with this flow include:

Involving more than Keycloak in handling of credentials

Increased vulnerable surface area where credential leaks can happen

Creating an ecosystem where users trust another application for entering their credentials and not Keycloak

Merge request reports

Loading