Class AccessTokenOptions.Builder
java.lang.Object
com.jalios.jcms.authentication.accesstoken.AccessTokenOptions.Builder
- Enclosing class:
AccessTokenOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the author of the token (not the member used to sign in, but the Member who created it)build()Build a new AccessTokenOptions.Require expiration of token in specified duration.expiresOn(long expirationTime) Require expiration of token at specified timeSet the regular expression to check client IP authorized use with the tokenSet the method authorized for use with the tokenSet the name describing the tokenRequire a token without expiration.prefixMode(boolean prefixMode) Tells if an token has to be generated for only a given URL (default behaviour), or a range of URL beginning with a given prefix (prefix mode).Indicate that this token is created to be revokable.revokable(boolean revokable) Indicate wether this token is created to be revokable or not.technical(boolean technical) Set wether token is created manually or programmaticallyIndicate this token is created manually by a user action in the token manager UI.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Set the name describing the token- Parameters:
name- the name of the token- Returns:
- this for method chaining
-
prefixMode
Tells if an token has to be generated for only a given URL (default behaviour), or a range of URL beginning with a given prefix (prefix mode).- Parameters:
prefixMode- true to enable prefix mode, false to allow exact URL- Returns:
- this for method chaining
-
expiresOn
Require expiration of token at specified time- Parameters:
expirationTime- epoch time- Returns:
- this for method chaining
-
expiresIn
Require expiration of token in specified duration.- Parameters:
duration- a duration- Returns:
- this for method chaining
-
neverExpires
Require a token without expiration.- Returns:
- this for method chaining
-
methods
Set the method authorized for use with the token- Parameters:
methods- some HTTP method name, upper case (GET, POST, PUT, DELETE)- Returns:
- this for method chaining
-
ipMask
Set the regular expression to check client IP authorized use with the token- Parameters:
ipMask- a regular expression- Returns:
- this for method chaining
-
revokable
Indicate wether this token is created to be revokable or not.- Returns:
- this for method chaining
-
revokable
Indicate that this token is created to be revokable.- Returns:
- this for method chaining
-
author
Set the author of the token (not the member used to sign in, but the Member who created it)- Parameters:
author- a Member- Returns:
- this for method chaining
-
userCreated
Indicate this token is created manually by a user action in the token manager UI.- Returns:
- this for method chaining
-
technical
Set wether token is created manually or programmatically- Parameters:
technical- true if token is being created automatically by a program (default value), false if token was created manually by a user action in the token manager UI.- Returns:
- this for method chaining
-
build
Build a new AccessTokenOptions.- Returns:
- a new AccessTokenOptions instance.
-