KerberosAuthority implements Authority { boolean isTargetPrincipal(KerberosTicket ticket, String remoteSvcPrincipal) { if (ticket == null) { return false; } KerberosPrincipal principal = ticket.getServer(); if (LOG.isDebugEnabled()) { LOG.debug("KerberosAuthority:isTargetPrincipal: our princ=" + servicePrincipal + " ticket princ=" + principal.getName()); } return principal.getName().equals(remoteSvcPrincipal); } KerberosAuthority(String servicePrincipal, String keyTabConfFile, String jaasConfigSection);  KerberosAuthority(); Exception getInitState(); void setInitState(Exception exc); long getLoginWindow(); void setLoginWindow(long loginWindowMillis); long getLastLogin(); @Override void initialize(); @Override String getID(); @SuppressWarnings({ "unchecked", "rawtypes" }) synchronized void login(boolean logoutFirst); boolean refreshLogin(String remoteSvcPrincipal); @Override String getDomain(); @Override String getHeader(); @Override String getAuthenticateChallenge(); @Override Principal authenticate(String creds, String remoteAddr, String httpMethod, StringBuilder errMsg);  }
@Test(groups="kerberos-tests") public void testIsTargetPrincipalIlligal() { KerberosAuthority check = new KerberosAuthority(); assertFalse(check.isTargetPrincipal(null,null)); }