All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilterCustom Maven / Gradle / Ivy

package org.springframework.security.web.authentication;

import javax.servlet.http.HttpServletRequest;

public class UsernamePasswordAuthenticationFilterCustom extends org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter {

  @Override
  protected String obtainUsername(HttpServletRequest request) {
    String username = super.obtainUsername(request);
    if (username == null) {
      return null;
    }
    int indexOf = username.indexOf('@');
    if (indexOf != -1) {
      username = username.substring(0, indexOf);
    }
    return username;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy