@Test public void testInvalidHeader() { when(request.getHeader("Authorization")).thenReturn("Basic c29tZXRoaW5n"); final Credentials<UserPasswordToken> extractedCredentials = parser.extractCredentials(request); assertNull(extractedCredentials); }
public Credentials<UserPasswordToken> extractCredentials(final Request request) { final String basicAuthHeader = request.getHeader(BASIC_AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX)) { return extractCredentials(basicAuthHeader); } else { return null; } }
BasicAuthenticationHeaderParser { public Credentials<UserPasswordToken> extractCredentials(final Request request) { final String basicAuthHeader = request.getHeader(BASIC_AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX)) { return extractCredentials(basicAuthHeader); } else { return null; } } }
BasicAuthenticationHeaderParser { public Credentials<UserPasswordToken> extractCredentials(final Request request) { final String basicAuthHeader = request.getHeader(BASIC_AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX)) { return extractCredentials(basicAuthHeader); } else { return null; } }  }
BasicAuthenticationHeaderParser { public Credentials<UserPasswordToken> extractCredentials(final Request request) { final String basicAuthHeader = request.getHeader(BASIC_AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX)) { return extractCredentials(basicAuthHeader); } else { return null; } }  Credentials<UserPasswordToken> extractCredentials(final Request request); }
BasicAuthenticationHeaderParser { public Credentials<UserPasswordToken> extractCredentials(final Request request) { final String basicAuthHeader = request.getHeader(BASIC_AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(basicAuthHeader) && basicAuthHeader.startsWith(BASIC_PREFIX)) { return extractCredentials(basicAuthHeader); } else { return null; } }  Credentials<UserPasswordToken> extractCredentials(final Request request); static final String BASIC_AUTHORIZATION_HEADER; static final String BASIC_PREFIX; }