use of com.nike.cerberus.domain.AuthTokenInfo in project cerberus by Nike-Inc.
the class AuthTokenService method getCerberusAuthTokenFromJwt.
private CerberusAuthToken getCerberusAuthTokenFromJwt(String principal, PrincipalType principalType, boolean isAdmin, String groups, long ttlInMinutes, int refreshCount, String id, OffsetDateTime now) throws AuthTokenTooLongException {
AuthTokenInfo authTokenInfo;
String token;
authTokenInfo = new CerberusJwtClaims().setId(id).setCreatedTs(now).setExpiresTs(now.plusMinutes(ttlInMinutes)).setPrincipal(principal).setPrincipalType(principalType.getName()).setIsAdmin(isAdmin).setGroups(groups).setRefreshCount(refreshCount);
token = jwtService.generateJwtToken((CerberusJwtClaims) authTokenInfo);
return getCerberusAuthTokenFromRecord(token, authTokenInfo);
}
Aggregations