All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.auth0.jwt.JWT Maven / Gradle / Ivy

Go to download

This is a drop in replacement for the auth0 java-jwt library (see https://github.com/auth0/java-jwt). This jar makes sure there are no external dependencies (e.g. fasterXml, Apacha Commons) needed. This is useful when deploying to an application server (e.g. tomcat with Alfreso or Pega).

The newest version!
package com.auth0.jwt;

import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTDecodeException;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.auth0.jwt.interfaces.Verification;

@SuppressWarnings("WeakerAccess")
public abstract class JWT {

    /**
     * Decode a given Json Web Token.
     * 

* Note that this method doesn't verify the token's signature! Use it only if you trust the token or you already verified it. * * @param token with jwt format as string. * @return a decoded JWT. * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. */ public static DecodedJWT decode(String token) throws JWTDecodeException { return new JWTDecoder(token); } /** * Returns a {@link JWTVerifier} builder with the algorithm to be used to validate token signature. * * @param algorithm that will be used to verify the token's signature. * @return {@link JWTVerifier} builder * @throws IllegalArgumentException if the provided algorithm is null. */ public static Verification require(Algorithm algorithm) { return JWTVerifier.init(algorithm); } /** * Returns a Json Web Token builder used to create and sign tokens * * @return a token builder. */ public static JWTCreator.Builder create() { return JWTCreator.init(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy