private static final Logger log = Logger.getLogger(IPAddressHandler.class);
- /** the URI of the AuthnContextDeclRef or the AuthnContextClass */
+ /** The URI of the AuthnContextDeclRef or the AuthnContextClass */
private String authnMethodURI;
+ /** The username to use for IP-address "authenticated" users. */
+ private String username;
+
/** Are the IPs in ipList a permitted list or a deny list */
private boolean defaultDeny;
return true;
}
+ /**
+ * Set the username to use for all IP-address authenticated users.
+ *
+ * @param username The username for IP-address authenticated users.
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * Get the username for all IP-address authenticated users.
+ *
+ * @return The username for IP-address authenticated users.
+ */
+ public String getUsername() {
+ return username;
+ }
+
/** {@inheritDoc} */
public void logout(final HttpServletRequest request,
final HttpServletResponse response, final String principal) {
loginCtx.setAuthenticationAttempted();
loginCtx.setAuthenticationInstant(new DateTime());
+ loginCtx.setUserID(username);
if (defaultDeny) {
handleDefaultDeny(request, response, loginCtx);