comments!

pull/59/head
Justin Richer 2011-12-22 16:40:25 -05:00
parent 8998d22369
commit a2c5c99b63
1 changed files with 9 additions and 0 deletions

View File

@ -92,6 +92,15 @@ public class JwtTest {
JwtSigner signer = new Hmac256Signer(key);
/*
* Token string based on the following strucutres, serialized exactly as follows and base64 encoded:
*
* header: {"typ":"JWT","alg":"HS256"}
* claims: {"exp":1300819380,"iss":"joe","http://example.com/is_root":true}
*
* Expected signature: iGBPJj47S5q_HAhSoQqAdcS6A_1CFj3zrLaImqNbt9E
*
*/
String jwtString = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjEzMDA4MTkzODAsImlzcyI6ImpvZSIsImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.iGBPJj47S5q_HAhSoQqAdcS6A_1CFj3zrLaImqNbt9E";
boolean valid = signer.verify(jwtString);