File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
lib/src/main/java/com/auth0/jwt Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 9090 JWTVerifier verifier = JWT . require(Algorithm . HMAC256 (" secret" ))
9191 .withIssuer(" auth0" )
9292 .build(); // Reusable verifier instance
93- JWT jwt = verifier. verify(token);
93+ DecodedJWT jwt = verifier. verify(token);
9494} catch (JWTVerificationException exception){
9595 // Invalid signature/claims
9696}
@@ -105,7 +105,7 @@ try {
105105 JWTVerifier verifier = JWT . require(Algorithm . RSA256 (key))
106106 .withIssuer(" auth0" )
107107 .build(); // Reusable verifier instance
108- JWT jwt = verifier. verify(token);
108+ DecodedJWT jwt = verifier. verify(token);
109109} catch (JWTVerificationException exception){
110110 // Invalid signature/claims
111111}
@@ -155,7 +155,7 @@ JWTVerifier verifier = verification.build(clock);
155155``` java
156156String token = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.AbIJTDMFc7yUa5MhvcP03nJPyCPzZtQcGEp-zWfOkEE" ;
157157try {
158- JWT jwt = JWT . decode(token);
158+ DecodedJWT jwt = JWT . decode(token);
159159} catch (JWTDecodeException exception){
160160 // Invalid token
161161}
Original file line number Diff line number Diff line change 99public abstract class JWT implements DecodedJWT {
1010
1111 /**
12- * Decode a given JWT token .
12+ * Decode a given Json Web Token .
1313 * <p>
1414 * Note that this method <b>doesn't verify the token's signature!</b> Use it only if you trust the token or you already verified it.
1515 *
1616 * @param token with jwt format as string.
17- * @return a decoded token .
17+ * @return a decoded JWT .
1818 * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts.
1919 */
20- public static JWT decode (String token ) throws JWTDecodeException {
20+ public static DecodedJWT decode (String token ) throws JWTDecodeException {
2121 return new JWTDecoder (token );
2222 }
2323
@@ -33,9 +33,9 @@ public static Verification require(Algorithm algorithm) {
3333 }
3434
3535 /**
36- * Returns a JWT builder used to create and sign jwt tokens
36+ * Returns a Json Web Token builder used to create and sign tokens
3737 *
38- * @return a jwt token builder.
38+ * @return a token builder.
3939 */
4040 public static JWTCreator .Builder create () {
4141 return JWTCreator .init ();
You can’t perform that action at this time.
0 commit comments