Enable Basic authentication
Enable Basic authentication for your Quarkus project and allow users to authenticate with a username and password.
You have installed at least one extension that provides an
IdentityProviderbased on username and password, such as Elytron JDBC.
Enable Basic authentication by setting the value of
An easy way to configure the required user credentials for Basic authentication to work is to configure the user name, secret, and roles directly in the
quarkus.http.auth.basic=true quarkus.security.users.embedded.plain-text=true quarkus.security.users.embedded.users.alice=alice quarkus.security.users.embedded.users.bob=bob quarkus.security.users.embedded.roles.alice=admin quarkus.security.users.embedded.roles.bob=user
In this configuration the credentials for users
bob are configured:
alice has a password
alice and an
bob has a password
bob and a
For more information, see Configuring User Information in the "Security Testing" guide.
Configuring user names, secrets, and roles in the
To walk through how to configure Basic authentication together with Jakarta Persistence for storing user credentials in a database, see the Secure a Quarkus application with Basic authentication tutorial.