LoginResource { @Path("/login") @POST public void login( @FormParam("username") String username, @FormParam("password") String password, @FormParam("rememberMe") boolean rememberMe, @Auth Subject subject) throws IOException { ensurePresent(username, "Invalid credentials: missing username."); ensurePresent(password, "Invalid credentials: missing password."); try { subject.login(new UsernamePasswordToken(username, password, rememberMe)); } catch (AuthenticationException e) { throw new IncorrectCredentialsException("Invalid credentials combination for user: " + username); } }  @Path("/login") @POST void login(
      @FormParam("username") String username,
      @FormParam("password") String password,
      @FormParam("rememberMe") boolean rememberMe,
      @Auth Subject subject); @Path("/logout") @POST void logout(@Auth Subject subject);  }
@Test public void testLogin() throws IOException { try (InputStream is = ResourceUtils.getInputStreamForPath("classpath:shiro.ini")) { Ini ini = new Ini(); ini.load(is); new WebIniSecurityManagerFactory(ini).getInstance().authenticate(new UsernamePasswordToken("admin", "admin")); } }