File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,10 +9,16 @@ This was developed against `draft-ietf-oauth-json-web-token-08`.
99``` java
1010 public class Application {
1111 public static void main (String [] args ) {
12- Map<String ,String > decodedPayload = new JWTVerifier (" secret" , " audience" ). verify(" my-token" );
13-
14- // Get custom fields from decoded Payload
15- System . out. println(decodedPayload. get(" name" ));
12+ try {
13+ Map<String ,String > decodedPayload = new JWTVerifier (" secret" , " audience" ). verify(" my-token" );
14+
15+ // Get custom fields from decoded Payload
16+ System . out. println(decodedPayload. get(" name" ));
17+ } catch (SignatureException signatureException) {
18+ System . err. println(" Invalid signature!" );
19+ } catch (IllegalStateException illegalStateException) {
20+ System . err. println(" Invalid Token! " + illegalStateException);
21+ }
1622 }
1723 }
1824```
You can’t perform that action at this time.
0 commit comments