use of org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderRegistrationTest method testBindUnbindTokenConfiguration.
@Test
public void testBindUnbindTokenConfiguration() throws Exception {
Field f = registration.getClass().getDeclaredField("tokenConfiguration");
f.setAccessible(true);
assertTrue(f.get(registration) instanceof CompositeTokenConfiguration);
TokenConfiguration tc = mockConfiguration(TokenConfiguration.class);
registration.bindTokenConfiguration(tc, PROPS);
CompositeTokenConfiguration composite = (CompositeTokenConfiguration) f.get(registration);
assertEquals(1, composite.getConfigurations().size());
assertTrue(composite.getConfigurations().contains(tc));
registration.unbindTokenConfiguration(tc, PROPS);
composite = (CompositeTokenConfiguration) f.get(registration);
assertTrue(composite.getConfigurations().isEmpty());
}
use of org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenConfiguration in project jackrabbit-oak by apache.
the class TokenLoginModuleCredentialsSupportTest method before.
@Before
public void before() throws Exception {
super.before();
userId = getTestUser().getID();
credentialsSupport = new TestCredentialsSupport(userId);
CompositeTokenConfiguration composite = ((CompositeTokenConfiguration) getSecurityProvider().getConfiguration(TokenConfiguration.class));
tc = (TokenConfigurationImpl) composite.getDefaultConfig();
tc.bindCredentialsSupport(credentialsSupport);
}
use of org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenConfiguration in project jackrabbit-oak by apache.
the class TokenExternalLoginModuleTest method before.
@Before
public void before() throws Exception {
super.before();
credentialsSupport = getCredentialsSupport();
// NOTE: should be replaced by proper OSGi setup
CompositeTokenConfiguration composite = ((CompositeTokenConfiguration) getSecurityProvider().getConfiguration(TokenConfiguration.class));
tc = (TokenConfigurationImpl) composite.getDefaultConfig();
tc.bindCredentialsSupport(credentialsSupport);
}
Aggregations