use of org.apache.jackrabbit.oak.spi.security.user.UserConfiguration in project jackrabbit-oak by apache.
the class SecurityProviderRegistrationTest method testBindUnbindUserConfiguration.
@Test
public void testBindUnbindUserConfiguration() throws Exception {
Field f = registration.getClass().getDeclaredField("userConfiguration");
f.setAccessible(true);
assertNull(f.get(registration));
UserConfiguration uc = mockConfiguration(UserConfiguration.class);
registration.bindUserConfiguration(uc);
assertSame(uc, f.get(registration));
registration.unbindUserConfiguration(uc);
assertNull(f.get(registration));
}
use of org.apache.jackrabbit.oak.spi.security.user.UserConfiguration in project jackrabbit-oak by apache.
the class LdapLoginTestBase method before.
@Before
public void before() throws Exception {
super.before();
if (!USE_COMMON_LDAP_FIXTURE) {
LDAP_SERVER.setUp();
createLdapFixture();
}
UserConfiguration uc = securityProvider.getConfiguration(UserConfiguration.class);
userManager = uc.getUserManager(root, NamePathMapper.DEFAULT);
}
use of org.apache.jackrabbit.oak.spi.security.user.UserConfiguration in project jackrabbit-oak by apache.
the class LoginModuleImpl method getUserAuthentication.
@CheckForNull
private Authentication getUserAuthentication(@Nullable String loginName) {
SecurityProvider securityProvider = getSecurityProvider();
Root root = getRoot();
if (securityProvider != null && root != null) {
UserConfiguration uc = securityProvider.getConfiguration(UserConfiguration.class);
UserAuthenticationFactory factory = uc.getParameters().getConfigValue(UserConstants.PARAM_USER_AUTHENTICATION_FACTORY, null, UserAuthenticationFactory.class);
if (factory != null) {
return factory.getAuthentication(uc, root, loginName);
} else {
log.error("No user authentication factory configured in user configuration.");
}
}
return null;
}
use of org.apache.jackrabbit.oak.spi.security.user.UserConfiguration in project jackrabbit-oak by apache.
the class PrincipalConfigurationImpl method getPrincipalProvider.
@Nonnull
@Override
public PrincipalProvider getPrincipalProvider(Root root, NamePathMapper namePathMapper) {
UserConfiguration uc = getSecurityProvider().getConfiguration(UserConfiguration.class);
PrincipalProvider principalProvider = uc.getUserPrincipalProvider(root, namePathMapper);
if (principalProvider != null) {
// use user-implementation specific principal provider implementation
return principalProvider;
} else {
// use default implementation acting on user management API
return new PrincipalProviderImpl(root, uc, namePathMapper);
}
}
use of org.apache.jackrabbit.oak.spi.security.user.UserConfiguration in project jackrabbit-oak by apache.
the class PermissionValidatorProvider method getUserContext.
Context getUserContext() {
if (userCtx == null) {
UserConfiguration uc = securityProvider.getConfiguration(UserConfiguration.class);
userCtx = uc.getContext();
}
return userCtx;
}
Aggregations