forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#39493 from michalvavrik/feature/add-form…
…-auth-login-event Fire SecurityEvent on Form authentication login success
- Loading branch information
Showing
4 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...runtime/src/main/java/io/quarkus/vertx/http/runtime/security/FormAuthenticationEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.quarkus.vertx.http.runtime.security; | ||
|
||
import java.util.Map; | ||
|
||
import io.quarkus.security.identity.SecurityIdentity; | ||
import io.quarkus.security.spi.runtime.AbstractSecurityEvent; | ||
|
||
public final class FormAuthenticationEvent extends AbstractSecurityEvent { | ||
|
||
public static final String FORM_CONTEXT = "io.quarkus.vertx.http.runtime.security.FormAuthenticationEvent#CONTEXT"; | ||
|
||
public enum FormEventType { | ||
/** | ||
* Event fired when a user was successfully authenticated with a call to the Form mechanism POST location. | ||
*/ | ||
FORM_LOGIN | ||
} | ||
|
||
private FormAuthenticationEvent(SecurityIdentity securityIdentity, Map<String, Object> eventProperties) { | ||
super(securityIdentity, eventProperties); | ||
} | ||
|
||
static FormAuthenticationEvent createLoginEvent(SecurityIdentity identity) { | ||
return new FormAuthenticationEvent(identity, Map.of(FORM_CONTEXT, FormEventType.FORM_LOGIN.toString())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters