Package org.apache.oltu.oauth2.jwt
Class JWT.Builder
- java.lang.Object
-
- org.apache.oltu.commons.json.CustomizableBuilder<JWT>
-
- org.apache.oltu.oauth2.jwt.JWT.Builder
-
- Enclosing class:
- JWT
public static final class JWT.Builder extends CustomizableBuilder<JWT>
A simpleJWTbuilder.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JWTbuild()Creates a newJWTinstance.JWT.BuildersetClaimsSetAudience(String claimsSetAudience)Sets the JWT Claims Setaudfor a single audience.JWT.BuildersetClaimsSetAudiences(List<String> claimsSetAudiences)Sets the JWT Claims Setaud.JWT.BuildersetClaimsSetCustomField(String key, Object value)Set the JWT Claims Set custom field.JWT.BuildersetClaimsSetExpirationTime(long claimsSetExpirationTime)Sets the JWT Claims Setexp.JWT.BuildersetClaimsSetIssuedAt(long claimsSetIssuedAt)Sets the JWT Claims SetissuedAt.JWT.BuildersetClaimsSetIssuer(String claimsSetIssuer)Sets the JWT Claims Setiss.JWT.BuildersetClaimsSetJwdId(String claimsSetJwdId)Sets the JWT Claims Setjti.JWT.BuildersetClaimsSetNotBefore(String claimsSetNotBefore)Sets the JWT Claims Setnbf.JWT.BuildersetClaimsSetSubject(String claimsSetSubject)Sets the JWT Claims Setsub.JWT.BuildersetClaimsSetType(String claimsSetType)Sets the JWT Claims Settyp.JWT.BuildersetHeaderAlgorithm(String headerAlgorithm)Sets the JWT Headeralg.JWT.BuildersetHeaderContentType(String headerContentType)Sets the JWT Headercty.JWT.BuildersetHeaderCustomField(String key, Object value)Set the JWT Header custom field.JWT.BuildersetHeaderType(String headerType)Sets the JWT Headertyp.JWT.BuildersetSignature(String signature)Sets the JWT signature.-
Methods inherited from class org.apache.oltu.commons.json.CustomizableBuilder
setCustomField
-
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(String rawString)
-
-
Method Detail
-
setHeaderType
public JWT.Builder setHeaderType(String headerType)
Sets the JWT Headertyp.- Parameters:
headerType- the JWT Headertyp.- Returns:
- this builder instance.
-
setHeaderAlgorithm
public JWT.Builder setHeaderAlgorithm(String headerAlgorithm)
Sets the JWT Headeralg.- Parameters:
headerAlgorithm- the JWT Headeralg.- Returns:
- this builder instance.
-
setHeaderContentType
public JWT.Builder setHeaderContentType(String headerContentType)
Sets the JWT Headercty.- Parameters:
headerContentType- the JWT Headercty.- Returns:
- this builder instance.
-
setHeaderCustomField
public JWT.Builder setHeaderCustomField(String key, Object value)
Set the JWT Header custom field.- Parameters:
key- the custom field name.value- value the custom field value.- Returns:
- this builder instance.
-
setClaimsSetIssuer
public JWT.Builder setClaimsSetIssuer(String claimsSetIssuer)
Sets the JWT Claims Setiss.- Parameters:
claimsSetIssuer- the JWT Claims Setiss.- Returns:
- this builder instance.
-
setClaimsSetSubject
public JWT.Builder setClaimsSetSubject(String claimsSetSubject)
Sets the JWT Claims Setsub.- Parameters:
claimsSetSubject- the JWT Claims Setsub.- Returns:
- this builder instance.
-
setClaimsSetAudience
public JWT.Builder setClaimsSetAudience(String claimsSetAudience)
Sets the JWT Claims Setaudfor a single audience.- Parameters:
claimsSetAudience- the JWT Claims Setaud.- Returns:
- this builder instance.
-
setClaimsSetAudiences
public JWT.Builder setClaimsSetAudiences(List<String> claimsSetAudiences)
Sets the JWT Claims Setaud.- Parameters:
claimsSetAudiences- the JWT Claims Setaud.- Returns:
- this builder instance.
-
setClaimsSetExpirationTime
public JWT.Builder setClaimsSetExpirationTime(long claimsSetExpirationTime)
Sets the JWT Claims Setexp.- Parameters:
claimsSetExpirationTime- the JWT Claims Setexp.- Returns:
- this builder instance.
-
setClaimsSetNotBefore
public JWT.Builder setClaimsSetNotBefore(String claimsSetNotBefore)
Sets the JWT Claims Setnbf.- Parameters:
claimsSetNotBefore- the JWT Claims Setnbf.- Returns:
- this builder instance.
-
setClaimsSetIssuedAt
public JWT.Builder setClaimsSetIssuedAt(long claimsSetIssuedAt)
Sets the JWT Claims SetissuedAt.- Parameters:
claimsSetIssuedAt- the JWT Claims SetissuedAt.- Returns:
- this builder instance.
-
setClaimsSetJwdId
public JWT.Builder setClaimsSetJwdId(String claimsSetJwdId)
Sets the JWT Claims Setjti.- Parameters:
claimsSetJwdId- the JWT Claims Setjti.- Returns:
- this builder instance.
-
setClaimsSetType
public JWT.Builder setClaimsSetType(String claimsSetType)
Sets the JWT Claims Settyp.- Parameters:
claimsSetType- the JWT Claims Settyp.- Returns:
- this builder instance.
-
setClaimsSetCustomField
public JWT.Builder setClaimsSetCustomField(String key, Object value)
Set the JWT Claims Set custom field.- Parameters:
key- the custom field name.value- value the custom field value.- Returns:
- this builder instance.
-
setSignature
public JWT.Builder setSignature(String signature)
Sets the JWT signature.- Parameters:
signature-- Returns:
- this builder instance.
-
-