@Test public void testIsNotApplicableWithEmtpyUserAndToken() { XOauth2Mechanism mech = new XOauth2Mechanism(); assertFalse("Should not be applicable with empty user and token", mech.isApplicable("", "", null)); }
@Override public boolean isApplicable(String username, String password, Principal localPrincipal) { if(username != null && username.length() > 0 && password != null && password.length() > 0) { return ACCESS_TOKEN_PATTERN.matcher(password).matches(); } else { return false; } }
XOauth2Mechanism extends AbstractMechanism { @Override public boolean isApplicable(String username, String password, Principal localPrincipal) { if(username != null && username.length() > 0 && password != null && password.length() > 0) { return ACCESS_TOKEN_PATTERN.matcher(password).matches(); } else { return false; } } }
XOauth2Mechanism extends AbstractMechanism { @Override public boolean isApplicable(String username, String password, Principal localPrincipal) { if(username != null && username.length() > 0 && password != null && password.length() > 0) { return ACCESS_TOKEN_PATTERN.matcher(password).matches(); } else { return false; } }  }
XOauth2Mechanism extends AbstractMechanism { @Override public boolean isApplicable(String username, String password, Principal localPrincipal) { if(username != null && username.length() > 0 && password != null && password.length() > 0) { return ACCESS_TOKEN_PATTERN.matcher(password).matches(); } else { return false; } }  @Override int getPriority(); @Override String getName(); @Override byte[] getInitialResponse(); @Override byte[] getChallengeResponse(byte[] challenge); @Override boolean isApplicable(String username, String password, Principal localPrincipal); @Override String getAdditionalFailureInformation(); }
XOauth2Mechanism extends AbstractMechanism { @Override public boolean isApplicable(String username, String password, Principal localPrincipal) { if(username != null && username.length() > 0 && password != null && password.length() > 0) { return ACCESS_TOKEN_PATTERN.matcher(password).matches(); } else { return false; } }  @Override int getPriority(); @Override String getName(); @Override byte[] getInitialResponse(); @Override byte[] getChallengeResponse(byte[] challenge); @Override boolean isApplicable(String username, String password, Principal localPrincipal); @Override String getAdditionalFailureInformation();  }