Skip to content

Commit 588cd87

Browse files
committed
Update README.md
Update the sample application to make it works for Auth0's users. Update maven to the latest version of java-jwt 2.1.0
1 parent c3d9662 commit 588cd87

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
An implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html) developed against `draft-ietf-oauth-json-web-token-08`.
44

55
### Usage
6+
Note for Auth0 users:
7+
By default, Auth0's CLIENT_SECRET is base64-encoded.
8+
To work with JWTVerifier, it must be decoded first.
69

710
```java
811
public class Application {
912
public static void main (String [] args) {
1013
try {
14+
Base64 decoder = new Base64(true);
15+
byte[] secret = decoder.decodeBase64(CLIENT_SECRET);
1116
Map<String,Object> decodedPayload =
12-
new JWTVerifier("secret", "audience").verify("my-token");
17+
new JWTVerifier(secret, "audience").verify("my-token");
1318

1419
// Get custom fields from decoded Payload
1520
System.out.println(decodedPayload.get("name"));
@@ -30,7 +35,7 @@ Yes, here you are:
3035
<dependency>
3136
<groupId>com.auth0</groupId>
3237
<artifactId>java-jwt</artifactId>
33-
<version>2.0.1</version>
38+
<version>2.1.0</version>
3439
</dependency>
3540
```
3641

0 commit comments

Comments
 (0)