{"action":"created","issue":{"url":"https://api.github.com/repos/pac4j/pac4j/issues/493","repository_url":"https://api.github.com/repos/pac4j/pac4j","labels_url":"https://api.github.com/repos/pac4j/pac4j/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/pac4j/pac4j/issues/493/comments","events_url":"https://api.github.com/repos/pac4j/pac4j/issues/493/events","html_url":"https://github.com/pac4j/pac4j/pull/493","id":134838874,"number":493,"title":"HTTP Digest Direct Authenticator","user":{"login":"mirceac","id":294875,"avatar_url":"https://avatars.githubusercontent.com/u/294875?v=3","gravatar_id":"","url":"https://api.github.com/users/mirceac","html_url":"https://github.com/mirceac","followers_url":"https://api.github.com/users/mirceac/followers","following_url":"https://api.github.com/users/mirceac/following{/other_user}","gists_url":"https://api.github.com/users/mirceac/gists{/gist_id}","starred_url":"https://api.github.com/users/mirceac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirceac/subscriptions","organizations_url":"https://api.github.com/users/mirceac/orgs","repos_url":"https://api.github.com/users/mirceac/repos","events_url":"https://api.github.com/users/mirceac/events{/privacy}","received_events_url":"https://api.github.com/users/mirceac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-19T11:09:22Z","updated_at":"2016-02-23T08:01:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/493","html_url":"https://github.com/pac4j/pac4j/pull/493","diff_url":"https://github.com/pac4j/pac4j/pull/493.diff","patch_url":"https://github.com/pac4j/pac4j/pull/493.patch"},"body":"-implement RFC 2617 for digest authentication\r\nCreate DigestCredentials given Digest Authorization header\r\nThis has to be used similar as the Direct Basic Authenticator is used\r\nCreate new DigestAuthenticator intervace to validate DigestCredentials retrieved from the authenticator\r\n\r\nThe realm value is configurable:\r\n\r\n DirectDigestAuthClient digestAuthClient = new DirectDigestAuthClient(new SecurityDigestAuthenticator());\r\n digestAuthClient.setRealm(\"myRealm\");\r\n\r\nIn order to validate that Digest authentication is successful is needed that:\r\n\r\ndigestCredentials.getResponse().equals(digestCredentials.calculateServerDigest(true, pwd))\r\n\r\nwhere pwd is the user password kept in database.\r\nAccording to RFC 2617 the user may keep HA1 encoded format\r\nof the password in database: HA1=MD5(username-value + \":\" + realm-value + \":\" + passwd)\r\nIf the user keeps password in clear (not recommended) then the digest validation should be performed like this:\r\n\r\ndigestCredentials.getResponse().equals(digestCredentials.calculateServerDigest(false, pwd))\r\n\r\ndigestCredentials.getResponse() represents the client response digest\r\ndigestCredentials.calculcateServerDigest represents the server digest. These two must be equal for a successful digest authentication"},"comment":{"url":"https://api.github.com/repos/pac4j/pac4j/issues/comments/187592964","html_url":"https://github.com/pac4j/pac4j/pull/493#issuecomment-187592964","issue_url":"https://api.github.com/repos/pac4j/pac4j/issues/493","id":187592964,"user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T08:01:03Z","updated_at":"2016-02-23T08:01:03Z","body":"I will merge, but remove the interface. We'll add it if we need it later on.\r\n\r\nMany thanks @mirceac for your patience and tenacity on this!"}}