Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropwizard digest auth

Does Dropwizard also support digest authentication? All I found was Basic Authentication and OAuth. Example code for this would be nice.

If there is really no digest support and already exisitng code, what would be the best idea to do digest auth in DW?

Implementing filters will kill usage of non auth required resources.

What I found so far:

  • How can I test HMAC authentication using Dropwizard? (from 2012?)
  • http://gary-rowe.com/agilestack/2012/10/23/multibit-merchant-implementing-hmac-authentication-in-dropwizard/ (perhaps useful for later)
  • https://gist.github.com/usamadar/2912088 (HttpDigestAuthServlet handling digest auth)
like image 696
user3280180 Avatar asked Sep 29 '22 11:09

user3280180


2 Answers

AFAIK -- the answer is no (at least not officially). The only two supported auth schemes at the moment are Basic Auth + OAuth (http://dropwizard.io/manual/auth.html).

I wasn't able to find any third party authenticators either -- sorry :(

like image 58
rdegges Avatar answered Oct 04 '22 03:10

rdegges


Take a look at authentication bundles like https://github.com/yammer/dropwizard-auth-ldap

Basically you can create your own Authenticator which you will use via the @User annotation on the resource endpoints. The only restrictions you have on Authenticators are that they return an Optional of whatever type you want.

It's really pretty flexible and if im not mistaken digest is really just a base64 encoded string of username:password mangled together with a cleartext username right?

so username:base64(username:password)? that should be easy to code up quickly.

like image 43
sepiroth887 Avatar answered Oct 04 '22 02:10

sepiroth887