public static String [ ] extractBasicAuthCredentials ( String authHeader ) { return new String ( Base64 . decodeBase64 ( authHeader . substring ( "Basic " . length ( ) ) . getBytes ( ) ) ) . split ( ":" ) ; }
In return array zeroth element is user and first is password .