java.lang.Object
edu.iu.client.IuJsonBuilder<B>
iu.crypt.JwtBuilder<B>
- Type Parameters:
B- Concrete builder type
- All Implemented Interfaces:
WebTokenBuilder
- Direct Known Subclasses:
SessionJwtBuilder
public class JwtBuilder<B extends JwtBuilder<B>>
extends IuJsonBuilder<B>
implements WebTokenBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the token audience URIs.build()Builds aWebTokeninstance based on provided claim values.Sets the time after which the JWT should not be accepted.iat()Indicates thatWebTokenBuilder.build()should set the issued at time to the current time.Sets the token issuer URI.jti()Generates a unique token identifier.Provides a specific token identifier.Sets the time before which the JWT should not be accepted.Sets the nonce claim.protected voidprepare()Applies state just prior to building the token.Sets the subject of the JWT.Methods inherited from class edu.iu.client.IuJsonBuilder
build, copy, param, param, param, paramNames, toJson
-
Constructor Details
-
JwtBuilder
public JwtBuilder()Default constructor
-
-
Method Details
-
jti
Description copied from interface:WebTokenBuilderGenerates a unique token identifier.- Specified by:
jtiin interfaceWebTokenBuilder- Returns:
- this
-
jti
Description copied from interface:WebTokenBuilderProvides a specific token identifier.- Specified by:
jtiin interfaceWebTokenBuilder- Parameters:
tokenId- token identifier- Returns:
- this
-
iss
Description copied from interface:WebTokenBuilderSets the token issuer URI.- Specified by:
issin interfaceWebTokenBuilder- Parameters:
issuer-URI- Returns:
- this
-
aud
Description copied from interface:WebTokenBuilderSets the token audience URIs.- Specified by:
audin interfaceWebTokenBuilder- Parameters:
audience- at least oneURI- Returns:
- this
-
sub
Description copied from interface:WebTokenBuilderSets the subject of the JWT.- Specified by:
subin interfaceWebTokenBuilder- Parameters:
subject- (sub claim)- Returns:
- this
-
iat
Description copied from interface:WebTokenBuilderIndicates thatWebTokenBuilder.build()should set the issued at time to the current time.- Specified by:
iatin interfaceWebTokenBuilder- Returns:
- this
-
nbf
Description copied from interface:WebTokenBuilderSets the time before which the JWT should not be accepted.- Specified by:
nbfin interfaceWebTokenBuilder- Parameters:
notBefore- not before time (nbf claim)- Returns:
- this
-
exp
Description copied from interface:WebTokenBuilderSets the time after which the JWT should not be accepted.- Specified by:
expin interfaceWebTokenBuilder- Parameters:
expires- token expiration time (exp claim)- Returns:
- this
-
nonce
Description copied from interface:WebTokenBuilderSets the nonce claim.- Specified by:
noncein interfaceWebTokenBuilder- Parameters:
nonce- nonce claim value- Returns:
- this
- See Also:
-
prepare
protected void prepare()Applies state just prior to building the token.Call this method when overriding
build()to apply any final state, e.g., setting the iat claim value. -
build
Description copied from interface:WebTokenBuilderBuilds aWebTokeninstance based on provided claim values.- Specified by:
buildin interfaceWebTokenBuilder- Returns:
WebToken
-