Package com.palantir.tokens.auth
Class UnverifiedJsonWebToken
- java.lang.Object
-
- com.palantir.tokens.auth.UnverifiedJsonWebToken
-
@Immutable public abstract class UnverifiedJsonWebToken extends java.lang.ObjectRepresents the parsed form of a JWT but does not verify the token signature.The information provided by this class should not be used for any security-sensitive application unless verified through some other process (e.g. by querying another service known to perform validation).
An anticipated use of this class is making a best-effort user id extraction for logging.
-
-
Constructor Summary
Constructors Constructor Description UnverifiedJsonWebToken()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.Optional<java.lang.String>getUnverifiedSessionId()Returns the unverified session id for this token, i.e.abstract java.util.Optional<java.lang.String>getUnverifiedTokenId()Returns the unverified token id for this token, i.e.abstract java.lang.StringgetUnverifiedUserId()Returns the unverified user id, i.e., the "sub" (subject) field of the JWT.static UnverifiedJsonWebTokenof(BearerToken token)Attempts to create anUnverifiedJsonWebTokenfrom providedBearerToken.static java.util.Optional<UnverifiedJsonWebToken>tryParse(java.lang.String rawAuthHeader)Does a lower cost check on the structure of string provided before attempting to create anUnverifiedJsonWebToken.
-
-
-
Method Detail
-
getUnverifiedUserId
@Parameter public abstract java.lang.String getUnverifiedUserId()
Returns the unverified user id, i.e., the "sub" (subject) field of the JWT.
-
getUnverifiedSessionId
@Parameter public abstract java.util.Optional<java.lang.String> getUnverifiedSessionId()
Returns the unverified session id for this token, i.e. the "sid" field of the JWT or absent if this token does not contain session information.
-
getUnverifiedTokenId
@Parameter public abstract java.util.Optional<java.lang.String> getUnverifiedTokenId()
Returns the unverified token id for this token, i.e. the "jti" field of the JWT or absent if this token does not use the "jti" field as a unique identifier.
-
tryParse
public static java.util.Optional<UnverifiedJsonWebToken> tryParse(java.lang.String rawAuthHeader)
Does a lower cost check on the structure of string provided before attempting to create anUnverifiedJsonWebToken.
-
of
public static UnverifiedJsonWebToken of(BearerToken token)
Attempts to create anUnverifiedJsonWebTokenfrom providedBearerToken.The information provided by this class should not be used for any security-sensitive application unless verified through some other process (e.g. by querying another service known to perform validation).
An anticipated use of this class is making a best-effort user id extraction for logging.
-
-