We have a requirement to have a mix of open and auth'ed APIs. Is there a configuration technique to do so using dropwizard-auth?
I have something working by adding my own AuthFilter that then defers to BasicAuthFilter if the path is one that I need to auth. Like this
BasicCredentialAuthFilter<PrincipalImpl> basicAuthFilter = new Builder<PrincipalImpl>()
.buildAuthFilter();
return new AuthFilter<>()
{
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
if (((ContainerRequest) requestContext).getPath(true).equals("foo")) {
basicAuthFilter.filter(requestContext);
}
}
};
Thanks for any info!