@Test public void testCreateLoginContext() throws Exception { context.checking(new Expectations() { { oneOf(configuration).getAppConfigurationEntry(REALM_NAME); } }); LoginContext loginContext = factory.createLoginContext(new TypedCallbackHandlerMap()); context.assertIsSatisfied(); assertNotNull(loginContext); Subject subject = loginContext.getSubject(); assertNull(subject); }
@Override public LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks) throws LoginException { try { final DefaultLoginResult loginResult = new DefaultLoginResult(); DispatchCallbackHandler handler = createDefaultCallbackHandler(loginResult, additionalCallbacks); defineAuthenticationTokenScheme(additionalCallbacks); return createLoginContext(handler, loginResult); } catch (Exception e) { final String msg = String.format("%s", ERROR_MSG); if (logEnabled()) { LOG.trace(msg, e); } throw (LoginException) new LoginException(msg).initCause(e); } }
DefaultLoginContextFactory implements LoginContextFactory { @Override public LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks) throws LoginException { try { final DefaultLoginResult loginResult = new DefaultLoginResult(); DispatchCallbackHandler handler = createDefaultCallbackHandler(loginResult, additionalCallbacks); defineAuthenticationTokenScheme(additionalCallbacks); return createLoginContext(handler, loginResult); } catch (Exception e) { final String msg = String.format("%s", ERROR_MSG); if (logEnabled()) { LOG.trace(msg, e); } throw (LoginException) new LoginException(msg).initCause(e); } } }
DefaultLoginContextFactory implements LoginContextFactory { @Override public LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks) throws LoginException { try { final DefaultLoginResult loginResult = new DefaultLoginResult(); DispatchCallbackHandler handler = createDefaultCallbackHandler(loginResult, additionalCallbacks); defineAuthenticationTokenScheme(additionalCallbacks); return createLoginContext(handler, loginResult); } catch (Exception e) { final String msg = String.format("%s", ERROR_MSG); if (logEnabled()) { LOG.trace(msg, e); } throw (LoginException) new LoginException(msg).initCause(e); } } DefaultLoginContextFactory(String name,
                                      Configuration configuration); }
DefaultLoginContextFactory implements LoginContextFactory { @Override public LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks) throws LoginException { try { final DefaultLoginResult loginResult = new DefaultLoginResult(); DispatchCallbackHandler handler = createDefaultCallbackHandler(loginResult, additionalCallbacks); defineAuthenticationTokenScheme(additionalCallbacks); return createLoginContext(handler, loginResult); } catch (Exception e) { final String msg = String.format("%s", ERROR_MSG); if (logEnabled()) { LOG.trace(msg, e); } throw (LoginException) new LoginException(msg).initCause(e); } } DefaultLoginContextFactory(String name,
                                      Configuration configuration); String getName(); Configuration getConfiguration(); @Override LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks); @Override LoginContext createLoginContext(Subject subject, final String username, final char[] password); }
DefaultLoginContextFactory implements LoginContextFactory { @Override public LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks) throws LoginException { try { final DefaultLoginResult loginResult = new DefaultLoginResult(); DispatchCallbackHandler handler = createDefaultCallbackHandler(loginResult, additionalCallbacks); defineAuthenticationTokenScheme(additionalCallbacks); return createLoginContext(handler, loginResult); } catch (Exception e) { final String msg = String.format("%s", ERROR_MSG); if (logEnabled()) { LOG.trace(msg, e); } throw (LoginException) new LoginException(msg).initCause(e); } } DefaultLoginContextFactory(String name,
                                      Configuration configuration); String getName(); Configuration getConfiguration(); @Override LoginContext createLoginContext(TypedCallbackHandlerMap additionalCallbacks); @Override LoginContext createLoginContext(Subject subject, final String username, final char[] password);  }