You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<1> Send the one-time authorization code to the POST location.
246
+
247
+
Once Quarkus has generated the one-time authorization code, you need to deliver the code to a user by declaring a CDI bean that implements the `io.quarkus.security.spi.runtime.OneTimeAuthorizationCodeSender` interface.
<1> Use the Quarkus Mailer extension to send the email with the authorization code.
278
+
See the xref:mailer-reference.adoc[Quarkus Mailer Reference documentation] for more information about the mailer.
279
+
280
+
NOTE: By default Quarkus stores generated authorization codes in memory.
281
+
If you run your application in multiple instances, you need to store the codes in a database, clustered cache or other external storage.
282
+
It is possible to implement custom storage by declaring a CDI bean that implements the `io.quarkus.security.spi.runtime.OneTimeAuthorizationCodeAuthenticator` interface.
283
+
284
+
==== Password recovery using a one-time authorization code
285
+
286
+
Instead of using the one-time authorization code feature as the second authentication factor, you can enable using the code as the single authentication factor.
287
+
Users can still authenticate with the username and password, but for example if they forgot a password, they can generate the one-time authorization code to authenticate and use the session for the password recovery.
<1> Users can generate the one-time authorization code by sending a username (the `j_username` form param) to the `/generate-authorization-code` POST location.
296
+
297
+
.Example form for requesting the one-time authorization code
<1> Send the one-time authorization code to the POST location.
318
+
319
+
The one-time authorization code is send in the same fashion as described in the <<two-factor-auth>> section of this guide.
320
+
Once users are logged in, you can provide them with a form to change the password.
321
+
322
+
IMPORTANT: The `/generate-authorization-code` request path may need to access database or execute remote calls depending on the identity provider you are using.
323
+
In order to prevent the Denial-of-service attack, you should use load shedding to avoid system overload.
Copy file name to clipboardExpand all lines: extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/HttpSecurityProcessor.java
0 commit comments