return (IUserService) getService(IUserService.class, "/remoting-public/user.service", new CdmServiceRequestExecutor());\r
}\r
\r
+\r
+ public static IUserService getUserService(ICdmRemoteSource remoteSource) {\r
+ return (IUserService) getService(IUserService.class, "/remoting-public/user.service", remoteSource, new CommonsHttpInvokerRequestExecutor());\r
+ }\r
+\r
@Override\r
public IMetadataService getMetadataService() {\r
return (IMetadataService) getService(IMetadataService.class, "/remoting-public/metadata.service", new CommonsHttpInvokerRequestExecutor());\r
if(authenticationManager != null) {\r
return authenticationManager;\r
}\r
+\r
+ authenticationManager = getAuthenticationManager(getUserService());\r
+ return authenticationManager;\r
+ }\r
+\r
+ public static ProviderManager getAuthenticationManager(IUserService userService) {\r
Md5PasswordEncoder passwordEncoder = new Md5PasswordEncoder();\r
ReflectionSaltSource saltSource = new ReflectionSaltSource();\r
saltSource.setUserPropertyToUse("getUsername");\r
\r
DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider();\r
- daoAuthenticationProvider.setUserDetailsService(getUserService());\r
+ daoAuthenticationProvider.setUserDetailsService(userService);\r
daoAuthenticationProvider.setSaltSource(saltSource);\r
daoAuthenticationProvider.setPasswordEncoder(passwordEncoder);\r
\r
- authenticationManager = new ProviderManager(Arrays.asList((AuthenticationProvider)daoAuthenticationProvider));\r
- return authenticationManager;\r
+ return new ProviderManager(Arrays.asList((AuthenticationProvider)daoAuthenticationProvider));\r
}\r
\r
\r