Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Digest Authentication

Hi All,

We have requirement to do digest authentication in our proxy we know apigee doesn't have built-in policy for that so we are doing with java script policy. 

We are sending a request to server(with username and password) and server is responding with ( WWW-Authenticate →Digest realm="Users", nonce="YywQ5zlDGgTQs7Ki2r6HnPFQSemyS7Ea", qop="auth")

So we need to send  nonce and an encrypted version of the username, password and realm (a hash) with the use of md5 algorithm to the server.

So we are creating a java script policy to send above request but not getting correct response.

If anyone has done  digest-auth their advise will help us.

Thanks

 

Solved Solved
0 5 1,077
1 ACCEPTED SOLUTION

The problem with the MD5 in Message Templates is... the payload for the digest is sort of dynamic.  There's a bunch of If..THEN...ELSE stuff you need to deal with, to implement HTTP Digest correctly. 

I wrote a callout that shows how to do it. 

https://github.com/DinoChiesa/Apigee-Java-HttpDigest

I tested this with a few known-good HTTP Digest endpoints and it works.  It is limited in a few ways. Check the README.

View solution in original post

5 REPLIES 5