2.2. Procedure
In the
application.propertiesfile, set thequarkus.http.auth.basicproperty totrue.quarkus.http.auth.basic=trueOptional: In a non-production environment only and purely for testing Quarkus Security in your applications:
To enable authentication for the embedded realm, set the
quarkus.security.users.embedded.enabledproperty totrue.quarkus.security.users.embedded.enabled=trueYou can also configure the required user credentials, user name, secret, and roles. For example:
quarkus.http.auth.basic=true quarkus.security.users.embedded.enabled=true quarkus.security.users.embedded.plain-text=true quarkus.security.users.embedded.users.alice=alice1 quarkus.security.users.embedded.users.bob=bob2 quarkus.security.users.embedded.roles.alice=admin3 quarkus.security.users.embedded.roles.bob=user4 - 1 3
- The user,
alice, hasaliceas their password andadminas their role. - 2 4
- The user,
bob, hasbobas their password anduseras 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
application.propertiesfile is appropriate only for testing scenarios. For securing a production application, it is crucial to use a database to store this information.