Not sure what exactly is happening in your case (a stack trace would make it more readable). I'd expect a LoginException
in this situation.
Anyway, you shouldn't be using the getAdministrativeResourceResolver
method. It has been deprecated.
as of 2.4 (bundle version 2.5.0) because of inherent security issues. Services requiring specific permissions should use the getServiceResourceResolver(Map)
instead.
and further on:
NOTE: This method is intended for use by infrastructure bundles to access the repository and provide general services. This method MUST not be used to handle client requests of whatever kinds. To handle client requests a regular authenticated resource resolver retrieved through getResourceResolver(Map)
must be used.
Whatever problem you have might just disappear if you follow the advice from the Javadoc and implement this in a secure way.