Hi Marc
I looked at the code in trunk and 1.6 branch and there is no extra way to configure the service ranking of the UserAuthenticationFactory implementations. However, IMHO it would make sense to allow for explicit ordering and I will create an improvement request for that. But since that doesn't help with your setup on 1.6: IMO the bundle containing your implementation needs to have a start-level defined that makes it come before the built-in. What is also important to note: in case you don't already have that, you should add your custom UserAuthenticationFactory in the list of required service IDs with the SecurityProviderRegistration to make sure the SecurityProvider is only registered once your service is ready (see http://jackrabbit.apache.org/oak/docs/security/introduction.html#SecurityProvider). Equally, if you wanted to disable the default impl altogether you had to remove it from that required service IDs list before doing so otherwise the SecurityProvider would be unregistered. Hope that helps Angela ________________________________ From: [email protected] <[email protected]> Sent: Tuesday, February 12, 2019 7:39 PM To: [email protected] Subject: Issue Retrieving Custom UserAuthenticationFactory Hello all, I'm trying to implement a custom UserAuthenticationFactory. I can see the service in the Felix Services console. It has a service.ranking of 7000. I can also see the OOB UserAuthenticationFactoryImpl service with no service ranking specified. When I make a request, my corresponding CustomAuthenticationHandler(Sling) can pull the credentials out of the request. My CustomLoginModule is able to get those credentials. I've cribbed the implementation of GetUserAuthentication() from LoginModuleImpl. When I call this, I can see the call retrieve a UserAuthenticationFactory always returns the OOB UserAuthenticationFactoryImpl. If I step into the call, I can see in the WhiteboardUserAuthenticationFactory receives a list of two possible factory Services from getServices()(:48) which include both the OOTB UAF and my custom UAF. But the order of this list does not reflect any service ranking, so the OOTB UAF is always returned first. Is there another configuration I should be doing? I'm currently on 1.6.8. I could not find any JIRA tickets that would address this, but then again my JIRA-foo isn't the best. Much appreciated, Marc Davenport
