/** * Creates a LoginContext using the Configuration that was specified in * {@link #setConfiguration(Configuration)}. */ @Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); }
/** * Creates a LoginContext using the Configuration that was specified in * {@link #setConfiguration(Configuration)}. */ @Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); }
@Before public void setUp() throws Exception { Configuration configuration = mock(Configuration.class); publisher = mock(ApplicationEventPublisher.class); log = mock(Log.class); provider = new DefaultJaasAuthenticationProvider(); provider.setConfiguration(configuration); provider.setApplicationEventPublisher(publisher); provider.setAuthorityGranters(new AuthorityGranter[] { new TestAuthorityGranter() }); provider.afterPropertiesSet(); AppConfigurationEntry[] aces = new AppConfigurationEntry[] { new AppConfigurationEntry( TestLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, Collections.<String, Object> emptyMap()) }; when(configuration.getAppConfigurationEntry(provider.getLoginContextName())) .thenReturn(aces); token = new UsernamePasswordAuthenticationToken("user", "password"); ReflectionTestUtils.setField(provider, "log", log); }
/** * Creates a LoginContext using the Configuration that was specified in * {@link #setConfiguration(Configuration)}. */ @Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); }
/** * Creates a LoginContext using the Configuration that was specified in * {@link #setConfiguration(Configuration)}. */ @Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); }