JahiaLoginModule implements LoginModule { @Deprecated public static Credentials getCredentials(String username) { logger.warn("Getting credentials with empty realm for "+username); return getCredentials(username, null, null); }  @Override void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options); @Override boolean login(); static Token removeToken(String name, String key); static Token getToken(String name, String key); @Override boolean commit(); @Override boolean abort(); boolean logout(); static Credentials getSystemCredentials(); @Deprecated static Credentials getSystemCredentials(String username); static Credentials getSystemCredentials(String username, String realm); @Deprecated static Credentials getSystemCredentials(String username, List<String> deniedPathes); static Credentials getSystemCredentials(String username, String realm, List<String> deniedPathes); static Credentials getGuestCredentials(); @Deprecated static Credentials getCredentials(String username); static Credentials getCredentials(String username, String realm); @Deprecated static Credentials getCredentials(String username, List<String> deniedPathes); static Credentials getCredentials(String username, String realm, List<String> deniedPathes); static final String SYSTEM; static final String GUEST; static final String REALM_ATTRIBUTE; }
@Test public void testUserCredentials() throws HttpException { String user = "user1"; assertEquals(user, ((SimpleCredentials) JahiaLoginModule.getCredentials(user, (String) null)).getUserID()); assertEquals(user, ((SimpleCredentials) JahiaLoginModule.getCredentials(user, null, null)).getUserID()); }