-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #12198 from sberyozkin/code_authentication_listener
Add OIDC SecurityEvent
- Loading branch information
Showing
17 changed files
with
246 additions
and
14 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
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
47 changes: 47 additions & 0 deletions
47
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/SecurityEvent.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,47 @@ | ||
package io.quarkus.oidc; | ||
|
||
import io.quarkus.security.identity.SecurityIdentity; | ||
|
||
/** | ||
* Security event. | ||
* | ||
*/ | ||
public class SecurityEvent { | ||
public enum Type { | ||
/** | ||
* OIDC Login event which is reported after the first user authentication but also when the user's session | ||
* has expired and the user has re-authenticated at the OIDC provider site. | ||
*/ | ||
OIDC_LOGIN, | ||
/** | ||
* OIDC Session refreshed event is reported if it has been detected that an ID token will expire shortly and the session | ||
* has been successfully auto-refreshed without the user having to re-authenticate again at the OIDC site. | ||
*/ | ||
OIDC_SESSION_REFRESHED, | ||
/** | ||
* OIDC Session expired and refreshed event is reported if a session has expired but been successfully refreshed | ||
* without the user having to re-authenticate again at the OIDC site. | ||
*/ | ||
OIDC_SESSION_EXPIRED_AND_REFRESHED, | ||
/** | ||
* OIDC Logout event is reported when the current user has started an RP-initiated OIDC logout flow. | ||
*/ | ||
OIDC_LOGOUT_RP_INITIATED | ||
} | ||
|
||
private final Type eventType; | ||
private final SecurityIdentity securityIdentity; | ||
|
||
public SecurityEvent(Type eventType, SecurityIdentity securityIdentity) { | ||
this.eventType = eventType; | ||
this.securityIdentity = securityIdentity; | ||
} | ||
|
||
public Type getEventType() { | ||
return eventType; | ||
} | ||
|
||
public SecurityIdentity getSecurityIdentity() { | ||
return securityIdentity; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.