Class TokenResponse.Builder
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.duo.nimbus.impl.TokenResponse.Builder
-
- All Implemented Interfaces:
TokenResponse.IAccessTokenStage,TokenResponse.IBuildStage,TokenResponse.IIdTokenStage,TokenResponse.ITokenTypeStage
- Enclosing class:
- TokenResponse
public static final class TokenResponse.Builder extends Object implements TokenResponse.IIdTokenStage, TokenResponse.IAccessTokenStage, TokenResponse.ITokenTypeStage, TokenResponse.IBuildStage
Builder to buildTokenResponse.
-
-
Field Summary
Fields Modifier and Type Field Description private StringaccessTokenThe access token.private IntegerexpiresInThe expiry.private StringidTokenThe id token.private StringrefreshTokenThe refresh token - not supported by Duo.private StringscopeThe scope.private StringtokenTypeThe token type.
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenResponsebuild()Do the build.TokenResponse.ITokenTypeStagewithAccessToken(String accessTokenIn)Supply the access token.TokenResponse.IBuildStagewithExpiresIn(Integer expires)Supply the expiration.TokenResponse.IAccessTokenStagewithIdToken(String token)Supply the ID token.TokenResponse.IBuildStagewithRefreshToken(String refresh)Supply the refresh tokenTokenResponse.IBuildStagewithScope(String scopeIn)Supply the scope.TokenResponse.IBuildStagewithTokenType(String type)Supply the token type.
-
-
-
Field Detail
-
idToken
private String idToken
The id token.
-
accessToken
private String accessToken
The access token.
-
tokenType
private String tokenType
The token type.
-
refreshToken
private String refreshToken
The refresh token - not supported by Duo.
-
expiresIn
private Integer expiresIn
The expiry.
-
scope
private String scope
The scope.
-
-
Method Detail
-
withIdToken
public TokenResponse.IAccessTokenStage withIdToken(String token)
Description copied from interface:TokenResponse.IIdTokenStageSupply the ID token.- Specified by:
withIdTokenin interfaceTokenResponse.IIdTokenStage- Parameters:
token- the ID token- Returns:
- the next stage
-
withAccessToken
public TokenResponse.ITokenTypeStage withAccessToken(String accessTokenIn)
Description copied from interface:TokenResponse.IAccessTokenStageSupply the access token.- Specified by:
withAccessTokenin interfaceTokenResponse.IAccessTokenStage- Parameters:
accessTokenIn- the access token- Returns:
- the next stage
-
withTokenType
public TokenResponse.IBuildStage withTokenType(String type)
Description copied from interface:TokenResponse.ITokenTypeStageSupply the token type.- Specified by:
withTokenTypein interfaceTokenResponse.ITokenTypeStage- Parameters:
type- the token type- Returns:
- the next stage
-
withRefreshToken
public TokenResponse.IBuildStage withRefreshToken(String refresh)
Description copied from interface:TokenResponse.IBuildStageSupply the refresh token- Specified by:
withRefreshTokenin interfaceTokenResponse.IBuildStage- Parameters:
refresh- the refresh token- Returns:
- this builder
-
withExpiresIn
public TokenResponse.IBuildStage withExpiresIn(Integer expires)
Description copied from interface:TokenResponse.IBuildStageSupply the expiration.- Specified by:
withExpiresInin interfaceTokenResponse.IBuildStage- Parameters:
expires- the expiration- Returns:
- this builder
-
withScope
public TokenResponse.IBuildStage withScope(String scopeIn)
Description copied from interface:TokenResponse.IBuildStageSupply the scope.- Specified by:
withScopein interfaceTokenResponse.IBuildStage- Parameters:
scopeIn- the scope- Returns:
- this builder
-
build
public TokenResponse build()
Description copied from interface:TokenResponse.IBuildStageDo the build.- Specified by:
buildin interfaceTokenResponse.IBuildStage- Returns:
- the response
-
-