private String[] getUserNamePassword(HttpServletRequest httpServletRequest) throws AuthenticationException {
String basicHeader = httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME);
if (basicHeader == null) {
throw new AuthenticationException("Authorization Required");
}
String[] userNamePasswordArray = basicHeader.split(" ");
if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
throw new AuthenticationException("Authorization Required");
}
String decodedString = servletRequestHelper.decode(userNamePasswordArray[1]);
String[] array = decodedString.split(":");
if (array == null || array.length != 2) {
throw new AuthenticationException("Authorization Required");
}
return array;
}