@Test(expected = AuthenticationException.class) public void testLogIn() { defaultAuthentication.logIn(null); }
@Override public LoginToken logIn(final String authHeader) { LOGGER.debug("Authentication header received as: {}", authHeader); UserCredential credential = parseUsernamePassword(fromNullable(authHeader)); if (isBasicAuthenicationValid(credential)) { return withAccessToken(credential.toBase64Encode()).withTokenType(BASIC).build(); } else { throw new AuthenticationException("Authentication login failed. Invalid Login Credential"); } }
DefaultAuthentication implements Authentication { @Override public LoginToken logIn(final String authHeader) { LOGGER.debug("Authentication header received as: {}", authHeader); UserCredential credential = parseUsernamePassword(fromNullable(authHeader)); if (isBasicAuthenicationValid(credential)) { return withAccessToken(credential.toBase64Encode()).withTokenType(BASIC).build(); } else { throw new AuthenticationException("Authentication login failed. Invalid Login Credential"); } } }
DefaultAuthentication implements Authentication { @Override public LoginToken logIn(final String authHeader) { LOGGER.debug("Authentication header received as: {}", authHeader); UserCredential credential = parseUsernamePassword(fromNullable(authHeader)); if (isBasicAuthenicationValid(credential)) { return withAccessToken(credential.toBase64Encode()).withTokenType(BASIC).build(); } else { throw new AuthenticationException("Authentication login failed. Invalid Login Credential"); } } @Inject  DefaultAuthentication(final UserDirectory userDirectory); }
DefaultAuthentication implements Authentication { @Override public LoginToken logIn(final String authHeader) { LOGGER.debug("Authentication header received as: {}", authHeader); UserCredential credential = parseUsernamePassword(fromNullable(authHeader)); if (isBasicAuthenicationValid(credential)) { return withAccessToken(credential.toBase64Encode()).withTokenType(BASIC).build(); } else { throw new AuthenticationException("Authentication login failed. Invalid Login Credential"); } } @Inject  DefaultAuthentication(final UserDirectory userDirectory); @Override LoginToken logIn(final String authHeader); @Override LoginToken verifyToken(final String tokenHeader); @Override boolean logOut(final String tokenHeader); @Override UserInfo getUserExists(final String userEmail); }
DefaultAuthentication implements Authentication { @Override public LoginToken logIn(final String authHeader) { LOGGER.debug("Authentication header received as: {}", authHeader); UserCredential credential = parseUsernamePassword(fromNullable(authHeader)); if (isBasicAuthenicationValid(credential)) { return withAccessToken(credential.toBase64Encode()).withTokenType(BASIC).build(); } else { throw new AuthenticationException("Authentication login failed. Invalid Login Credential"); } } @Inject  DefaultAuthentication(final UserDirectory userDirectory); @Override LoginToken logIn(final String authHeader); @Override LoginToken verifyToken(final String tokenHeader); @Override boolean logOut(final String tokenHeader); @Override UserInfo getUserExists(final String userEmail); static final String BASIC; static final String EMPTY; }