Search in sources :

Example 1 with AuthTokenInfo

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);
}
Also used : AuthTokenInfo(com.nike.cerberus.domain.AuthTokenInfo) CerberusJwtClaims(com.nike.cerberus.jwt.CerberusJwtClaims)

Aggregations

AuthTokenInfo (com.nike.cerberus.domain.AuthTokenInfo)1 CerberusJwtClaims (com.nike.cerberus.jwt.CerberusJwtClaims)1