jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java
public static String resolveAuthUsername(final HttpServletRequest request) {
		String header = request.getHeader(HEADER_AUTHORIZATION);
		if (header == null) {
			return null;
		}
		if (!header.contains("Basic ")) {
			return null;
		}
		final String encoded = header.substring(header.indexOf(' ') + 1);
		final String decoded = new String(Base64.decode(encoded));
		return decoded.substring(0, decoded.indexOf(':'));
	}
public static String resolveAuthUsername(final HttpServletRequest request) {
		String header = request.getHeader(HEADER_AUTHORIZATION);
		if (header == null) {
			return null;
		}
		if (!header.contains("Basic ")) {
			return null;
		}
		final String encoded = header.substring(header.indexOf(' ') + 1);
		final String decoded = new String(Base64.decode(encoded));
		return decoded.substring(0, decoded.indexOf(':'));
	}
public static String resolveAuthUsername ( final HttpServletRequest request ) { String header = request . getHeader ( HEADER_AUTHORIZATION ) ; if ( header == null ) { return null ; } if ( ! header . contains ( "Basic " ) ) { return null ; } final String encoded = header . substring ( header . indexOf ( ' ' ) + 1 ) ; final String decoded = new String ( Base64 . decode ( encoded ) ) ; return decoded . substring ( 0 , decoded . indexOf ( ' ' ) ) ; }
Decodes the "Authorization" header and retrieves the
user's name from it. Returns <code>null</code> if the header is not present.
Decodes the Authorization header and retrieves the user s name from it . Returns <code > null< / code > if the header is not present .