Thomas,
I've just updated test2 with the suggested tests and they all pass in Restlet 2.0 M4. I suggest that you try again and let me know if you can get further.
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~
http://www.restlet.orgNoelios Technologies ~ Co-founder ~
http://www.noelios.com-----Message d'origine-----
De :
[hidden email] [mailto:
[hidden email]]
Envoyé : mardi 28 juillet 2009 12:10
À :
[hidden email]; Jerome Louvel
Objet : RE: How to implement Digest Authentication
Hi jérome,
Thanks for your answer with the attachment.
This allows me to understand the link between MapVerifier and SecretDigestVerifier classes.
However I've some issues with the tests "test2" and "test3" :
public void test2() {
MapVerifier mv = new MapVerifier();
mv.getSecrets().put("scott",
"RuPXcqGIjq3/JsetpH/XUC15bgc=".toCharArray());
SecretDigestVerifier sdv = new SecretDigestVerifier(
Digest.ALGORITHM_SHA_1, Digest.ALGORITHM_SHA_1, mv);
assertTrue(sdv.verify("scott", "RuPXcqGIjq3/JsetpH/XUC15bgc="
.toCharArray()));
}
public void test3() {
MapVerifier mv = new MapVerifier();
mv.getSecrets().put("scott",
"RuPXcqGIjq3/JsetpH/XUC15bgc=".toCharArray());
SecretDigestVerifier sdv = new SecretDigestVerifier(null,
Digest.ALGORITHM_SHA_1, mv);
assertTrue(sdv.verify("scott", "tiger".toCharArray()));
}
Indeed with "test2", when I change the name "scott" by "tom" in the condition of the assertTrue, the test is successfull.
May you help me to understand on this point?
Best regards
Tom
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2376251------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2385995