@Test public void testIsApplicableWithUserAndPasswordAndPrincipal() { XOauth2Mechanism mech = new XOauth2Mechanism(); assertTrue("Should be applicable with user and token and principal", mech.isApplicable("user", "2YotnFZFEjr1zCsicMWpAA", new Principal() { @Override public String getName() { return "name"; } })); }
@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();  }