class 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;
        }
    }

}