Results 1 to 5 of 5

Thread: Cleartext passwords required for digest authentication?

  1. #1
    Join Date
    Aug 2004
    Posts
    229

    Default Cleartext passwords required for digest authentication?

    So, if I want to use digest authentication I have to store my passwords as cleartext in the DB? Makes me a little nervous... I'm not familiar with the digest spec, but is there really no way around this?

    - Andy

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Afraid not Andy.

    Quoting our good friends at http://www.faqs.org/rfcs/rfc2617.html:

    Note that the HTTP server does not actually need to know the user's cleartext password. As long as H(A1) is available to the server, the validity of an Authorization header may be verified.
    and separately:

    A1 = unq(username-value) ":" unq(realm-value) ":" passwd
    So, it sort of can work without having the cleartext password. However, the hashed value will need to exactly match username + ":" + realm-value + ":" + password. However, you probably didn't store the original encoded password in that hash form now did you? :-)

  3. #3
    Join Date
    Aug 2004
    Posts
    229

    Default

    Fortunately for me, I'm still at that phase in my project where I can change how the password is stored.
    Unfortunately, storing the password as cleartext complicates things (such as our backup process, but that's another topic). Anyway, not having looked at the new digest authentication yet, maybe storing my passwords in that form is an option? My security code currently borrows the same PasswordEncoder that is passed into DaoAuthenticationProvider to encode passwords before sending them to the DB. I'm not sure if PasswordEncoder is flexible enough to encode the form you specify, but maybe DigestProcessingFilter could expose a method or interface to my security code so that it could properly encode a password before storing it in the DB? I guess that means DigestProcessingFilter would need some new way to query my DAO for the direct hashed value?

    - Andy

  4. #4
    Join Date
    Aug 2004
    Location
    Auburn, AL, USA.
    Posts
    106

    Default

    Just my 2cents; but when I first looked into it digest auth seems quite cool, as I explored it more I realized the 'plain' auth over HTTPS is usually a much better solution.

  5. #5
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    I think most applications with anything to protect will run HTTPS and use form or Basic authentication. It's the most portable solution, too.

    Where the opportunity for Digest comes in, though, is if you have a primary interface over HTTPS - such as the webapp - but some secondary interface that is technically too difficult to secure over TLS. A WebDAV web service comes to mind. With WebDAV you don't want users having to have HTTPS support in their clients (many simpler clients simply won't support it) yet you want to preserve the integrity of their password. In such situations, using Digest authentication becomes attractive.

    I agree, we should add a static method to DigestProcessingFilter or to a PasswordEncoder to make this more tidy. I'll add it to my TODO list.

Similar Threads

  1. Replies: 11
    Last Post: Jun 1st, 2006, 04:30 PM
  2. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  3. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  4. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •