Would the chained factories in dropwizard-auth meet your needs?

https://www.dropwizard.io/en/latest/manual/auth.html#chained-factories

Ryan

On Thu, Sep 9, 2021 at 9:59 AM John Bedalov <[email protected]> wrote:

> 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!
>
> --
> You received this message because you are subscribed to the Google Groups
> "dropwizard-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dropwizard-user/8b64d221-d54e-4016-b8ce-0f0395513723n%40googlegroups.com
> <https://groups.google.com/d/msgid/dropwizard-user/8b64d221-d54e-4016-b8ce-0f0395513723n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dropwizard-user/CAFVYhL8uwQfA6%3D-iSUSSXoHkJD%3DN-QMvWQBi2KEpfnWRq1_sxQ%40mail.gmail.com.

Reply via email to