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 CoreIdmEngineConfigurationengineConfigurationprotected Collection<String>groupKeysprotected StringuserIdprotected DurationvalidForprotected InstantvalidUntil
-
Constructor Summary
Constructors Constructor Description TokenAuthenticationBuilderImpl(CoreIdmEngineConfiguration engineConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenAuthenticationBuilderaddGroup(String groupKey)The granted group access for this token.TokenAuthenticationBuilderaddGroups(Collection<String> groupKeys)The granted groups access for this token.Tokencreate()Create the token.TokenAuthenticationBuilderuserId(String userId)The id of the user to which the token belongs.TokenAuthenticationBuildervalidFor(Duration validityDuration)The duration for which the token is valid.TokenAuthenticationBuildervalidUntil(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:TokenAuthenticationBuilderThe 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:
userIdin interfaceTokenAuthenticationBuilder- Parameters:
userId- the id of the user
-
addGroup
public TokenAuthenticationBuilder addGroup(String groupKey)
Description copied from interface:TokenAuthenticationBuilderThe granted group access for this token.- Specified by:
addGroupin interfaceTokenAuthenticationBuilder- Parameters:
groupKey- the key of the group
-
addGroups
public TokenAuthenticationBuilder addGroups(Collection<String> groupKeys)
Description copied from interface:TokenAuthenticationBuilderThe granted groups access for this token.- Specified by:
addGroupsin interfaceTokenAuthenticationBuilder- Parameters:
groupKeys- the group keys
-
validFor
public TokenAuthenticationBuilder validFor(Duration validityDuration)
Description copied from interface:TokenAuthenticationBuilderThe duration for which the token is valid. It must be a positive duration. This is mutually exclusive withTokenAuthenticationBuilder.validUntil(Instant).- Specified by:
validForin interfaceTokenAuthenticationBuilder- Parameters:
validityDuration- the positive duration
-
validUntil
public TokenAuthenticationBuilder validUntil(Instant validUntil)
Description copied from interface:TokenAuthenticationBuilderUntil when the token is valid. This is mutually exclusive withTokenAuthenticationBuilder.validFor(Duration).- Specified by:
validUntilin interfaceTokenAuthenticationBuilder- Parameters:
validUntil- the date until the token is valid
-
create
public Token create()
Description copied from interface:TokenAuthenticationBuilderCreate the token. The value of the token should be retrieved throughToken.getTokenData().- Specified by:
createin interfaceTokenAuthenticationBuilder- Returns:
- the created token
-
-