The English version of is the official project site. Translated sites are community supported on a best-effort basis.

Enable Basic authentication

Enable Basic authentication for your Quarkus project and allow users to authenticate with a username and password.


The following procedure outlines how you can enable Basic authentication for your application by using the elytron-security-properties-file extension.


  1. In the file, set the quarkus.http.auth.basic property to true.

  2. Optional: In a non-production environment only and purely for testing Quarkus Security in your applications:

    1. To enable authentication for the embedded realm, set the property to true.

    2. You can also configure the required user credentials, user name, secret, and roles. For example:

      quarkus.http.auth.basic=true (1) (2) (1) (2)
      1 The user, alice, has alice as their password and admin as their role.
      2 The user, bob, has bob as their password and user as their role.

      For information about other methods that you can use to configure the required user credentials, see the Configuring User Information section of the Quarkus "Security Testing" guide.

      Configuring user names, secrets, and roles in the file is appropriate only for testing scenarios. For securing a production application, it is crucial to use a database to store this information.

Next steps

For a more detailed walk-through that shows you how to configure Basic authentication together with Jakarta Persistence for storing user credentials in a database, see the Getting started with Security by using Basic authentication and Jakarta Persistence guide.

Related content