com.nimbusds.openid.connect.sdk.util.JWTDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oauth2-oidc-sdk Show documentation
Show all versions of oauth2-oidc-sdk Show documentation
OAuth 2.0 SDK with OpenID Connection extensions for developing client
and server applications.
package com.nimbusds.openid.connect.sdk.util;
import java.text.ParseException;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.ReadOnlyJWTClaimsSet;
/**
* Decoder of JSON Web Tokens (JWTs). Handles plain JWTs as well as JWTs
* secured by means of JSON Web Signature (JWS) and / or JSON Web Encryption
* (JWE). If the object is secured performs the necessary JWS validation and /
* or JWE decryption.
*/
public interface JWTDecoder {
/**
* Decodes a JWT object, then applies JWS signature validation and / or
* JWE decryption if the token is secured.
*
* @param jwt The JWT to decode. Must not be {@code null}.
*
* @return The JWT claims set.
*
* @throws JOSEException If decoding, JWS validation and / or JWE
* decryption of the JWT failed.
* @throws ParseException If parsing of the JWT claims set failed.
*/
public ReadOnlyJWTClaimsSet decodeJWT(final JWT jwt)
throws JOSEException, ParseException;
}