public interface AuditPrincipalIdProvider
extends org.springframework.core.Ordered
Useful for authentication scenarios where there is not only one primary principal id available, but additional authentication metadata in addition to custom requirement to compute and show more complex principal identifier for auditing purposes. An example would be compound ids resulted from multi-legged mfa authentications, 'surrogate' authentications, etc.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPrincipalIdFrom(Authentication authentication,
java.lang.Object resultValue,
java.lang.Exception exception)
Return principal id from a given authentication event.
|
boolean |
supports(Authentication authentication,
java.lang.Object resultValue,
java.lang.Exception exception)
Whether this provider can support the authentication transaction to provide a principal id.
|
java.lang.String getPrincipalIdFrom(Authentication authentication, java.lang.Object resultValue, java.lang.Exception exception)
authentication
- authentication event containing the data to computed the final principal id fromresultValue
- the result value that is currently processed by the executing op. May be null.exception
- the exception that may have occurred as part of the current executing op. May be null.boolean supports(Authentication authentication, java.lang.Object resultValue, java.lang.Exception exception)
authentication
- the authentication transaction.resultValue
- the result value that is currently processed by the executing op. May be null.exception
- the exception that may have occurred as part of the current executing op. May be null.