@Test @Ignore public void shouldAuthenticateUserWithNameAdminAndPasswordAdmin() throws Exception { SlingWebConsoleSecurityProvider slingWebConsoleSecurityProvider = new SlingWebConsoleSecurityProvider(); assertNotNull(slingWebConsoleSecurityProvider.authenticate("admin", "admin")); }
@Override public Object authenticate( String userName, String password ) { final Credentials creds = new SimpleCredentials(userName, (password == null) ? new char[0] : password.toCharArray()); Session session = null; ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); session = repository.login(creds); return true; } catch (LoginException re) { log.info( "authenticate: User " + userName + " failed to authenticate with the repository for Web Console access", re); } catch (RepositoryException re) { log.info("authenticate: Generic problem trying grant User " + userName + " access to the Web Console", re); } finally { Thread.currentThread().setContextClassLoader(ccl); if (session != null) { session.logout(); } } return null; }
SlingWebConsoleSecurityProvider implements WebConsoleSecurityProvider { @Override public Object authenticate( String userName, String password ) { final Credentials creds = new SimpleCredentials(userName, (password == null) ? new char[0] : password.toCharArray()); Session session = null; ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); session = repository.login(creds); return true; } catch (LoginException re) { log.info( "authenticate: User " + userName + " failed to authenticate with the repository for Web Console access", re); } catch (RepositoryException re) { log.info("authenticate: Generic problem trying grant User " + userName + " access to the Web Console", re); } finally { Thread.currentThread().setContextClassLoader(ccl); if (session != null) { session.logout(); } } return null; } }
SlingWebConsoleSecurityProvider implements WebConsoleSecurityProvider { @Override public Object authenticate( String userName, String password ) { final Credentials creds = new SimpleCredentials(userName, (password == null) ? new char[0] : password.toCharArray()); Session session = null; ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); session = repository.login(creds); return true; } catch (LoginException re) { log.info( "authenticate: User " + userName + " failed to authenticate with the repository for Web Console access", re); } catch (RepositoryException re) { log.info("authenticate: Generic problem trying grant User " + userName + " access to the Web Console", re); } finally { Thread.currentThread().setContextClassLoader(ccl); if (session != null) { session.logout(); } } return null; }  }
SlingWebConsoleSecurityProvider implements WebConsoleSecurityProvider { @Override public Object authenticate( String userName, String password ) { final Credentials creds = new SimpleCredentials(userName, (password == null) ? new char[0] : password.toCharArray()); Session session = null; ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); session = repository.login(creds); return true; } catch (LoginException re) { log.info( "authenticate: User " + userName + " failed to authenticate with the repository for Web Console access", re); } catch (RepositoryException re) { log.info("authenticate: Generic problem trying grant User " + userName + " access to the Web Console", re); } finally { Thread.currentThread().setContextClassLoader(ccl); if (session != null) { session.logout(); } } return null; }  @Override Object authenticate( String userName,
                                String password ); @Override boolean authorize( Object user,
                              String role ); }
SlingWebConsoleSecurityProvider implements WebConsoleSecurityProvider { @Override public Object authenticate( String userName, String password ) { final Credentials creds = new SimpleCredentials(userName, (password == null) ? new char[0] : password.toCharArray()); Session session = null; ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); session = repository.login(creds); return true; } catch (LoginException re) { log.info( "authenticate: User " + userName + " failed to authenticate with the repository for Web Console access", re); } catch (RepositoryException re) { log.info("authenticate: Generic problem trying grant User " + userName + " access to the Web Console", re); } finally { Thread.currentThread().setContextClassLoader(ccl); if (session != null) { session.logout(); } } return null; }  @Override Object authenticate( String userName,
                                String password ); @Override boolean authorize( Object user,
                              String role );  }