Interface TokenService
- All Known Implementing Classes:
DefaultTokenService
public interface TokenService
Service to create and verify token used to authorize to application.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
static final record
static enum
static final record
-
Method Summary
Modifier and TypeMethodDescriptioncreateUserToken
(StandardUser user, String name, Instant expiration, List<String> grantedAuthorities) getTokenById
(Long tokenId) getTokenForApp
(String appName) getTokensForUser
(long userId) void
revokeToken
(TokenService.Token token) verifyToken
(String token)
-
Method Details
-
createUserToken
String createUserToken(StandardUser user, String name, Instant expiration, List<String> grantedAuthorities) throws TokenCreationException - Throws:
TokenCreationException
-
createAppToken
String createAppToken(AppUser user, String name, Instant expiration, List<String> grantedAuthorities) throws TokenCreationException - Throws:
TokenCreationException
-
getTokensForUser
-
getTokenForApp
-
verifyToken
- Throws:
TokenVerificationException
-
getTokenById
-
revokeToken
-