Package com.flowable.idm.engine.impl
Class TokenAuthenticationBuilderImpl
- java.lang.Object
-
- com.flowable.idm.engine.impl.TokenAuthenticationBuilderImpl
-
- All Implemented Interfaces:
TokenAuthenticationBuilder
public class TokenAuthenticationBuilderImpl extends Object implements TokenAuthenticationBuilder
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected CoreIdmEngineConfiguration
engineConfiguration
protected Collection<String>
groupKeys
protected String
userId
protected Duration
validFor
protected Instant
validUntil
-
Constructor Summary
Constructors Constructor Description TokenAuthenticationBuilderImpl(CoreIdmEngineConfiguration engineConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenAuthenticationBuilder
addGroup(String groupKey)
The granted group access for this token.TokenAuthenticationBuilder
addGroups(Collection<String> groupKeys)
The granted groups access for this token.Token
create()
Create the token.TokenAuthenticationBuilder
userId(String userId)
The id of the user to which the token belongs.TokenAuthenticationBuilder
validFor(Duration validityDuration)
The duration for which the token is valid.TokenAuthenticationBuilder
validUntil(Instant validUntil)
Until when the token is valid.
-
-
-
Field Detail
-
engineConfiguration
protected final CoreIdmEngineConfiguration engineConfiguration
-
userId
protected String userId
-
groupKeys
protected Collection<String> groupKeys
-
validFor
protected Duration validFor
-
validUntil
protected Instant validUntil
-
-
Constructor Detail
-
TokenAuthenticationBuilderImpl
public TokenAuthenticationBuilderImpl(CoreIdmEngineConfiguration engineConfiguration)
-
-
Method Detail
-
userId
public TokenAuthenticationBuilder userId(String userId)
Description copied from interface:TokenAuthenticationBuilder
The id of the user to which the token belongs. This can be any user which isn't part of the Flowable Identity Service.- Specified by:
userId
in interfaceTokenAuthenticationBuilder
- Parameters:
userId
- the id of the user
-
addGroup
public TokenAuthenticationBuilder addGroup(String groupKey)
Description copied from interface:TokenAuthenticationBuilder
The granted group access for this token.- Specified by:
addGroup
in interfaceTokenAuthenticationBuilder
- Parameters:
groupKey
- the key of the group
-
addGroups
public TokenAuthenticationBuilder addGroups(Collection<String> groupKeys)
Description copied from interface:TokenAuthenticationBuilder
The granted groups access for this token.- Specified by:
addGroups
in interfaceTokenAuthenticationBuilder
- Parameters:
groupKeys
- the group keys
-
validFor
public TokenAuthenticationBuilder validFor(Duration validityDuration)
Description copied from interface:TokenAuthenticationBuilder
The duration for which the token is valid. It must be a positive duration. This is mutually exclusive withTokenAuthenticationBuilder.validUntil(Instant)
.- Specified by:
validFor
in interfaceTokenAuthenticationBuilder
- Parameters:
validityDuration
- the positive duration
-
validUntil
public TokenAuthenticationBuilder validUntil(Instant validUntil)
Description copied from interface:TokenAuthenticationBuilder
Until when the token is valid. This is mutually exclusive withTokenAuthenticationBuilder.validFor(Duration)
.- Specified by:
validUntil
in interfaceTokenAuthenticationBuilder
- Parameters:
validUntil
- the date until the token is valid
-
create
public Token create()
Description copied from interface:TokenAuthenticationBuilder
Create the token. The value of the token should be retrieved throughToken.getTokenData()
.- Specified by:
create
in interfaceTokenAuthenticationBuilder
- Returns:
- the created token
-
-