Class RacTokenService

java.lang.Object
com.totvs.tjf.security.oauth2.RacTokenService

@EnableScheduling public class RacTokenService extends Object
  • Constructor Details

    • RacTokenService

      public RacTokenService(com.fasterxml.jackson.databind.ObjectMapper mapper, SecurityAccessApiProperties properties, @Nullable org.springframework.web.client.RestTemplate restTemplate, org.springframework.cache.CacheManager cacheManager)
  • Method Details

    • getTenant

      @Cacheable(value="RacTokenServiceTenantCache", cacheResolver="tokenCacheResolver", key="#fluigTenant", condition="#fluigTenant != null") public String getTenant(String fluigTenant, String token)
      Gets the rac tenantId of the fluig companyId
      Parameters:
      fluigTenant - tenant available in jwt token
      token - jwt
      Returns:
      tenant tenant available in RAC
    • getTenant

      public HasAccess getTenant(String token)
      Gets the rac authorization from the fluig token
      Parameters:
      token - jwt
      Returns:
      hasAccess rac tenant authorization
    • getUserId

      @Cacheable(value="RacTokenServiceUserIdCache", cacheResolver="tokenCacheResolver", key="{#tenantId, #fluigUserId}", condition="#tenantId != null && #fluigUserId != null") public String getUserId(String tenantId, String fluigUserId, String token)
    • clearRacTokenServiceTenantCache

      @Scheduled(fixedRate=12L, timeUnit=HOURS) public void clearRacTokenServiceTenantCache()
    • clearRacTokenServiceUserIdCache

      @Scheduled(fixedRate=12L, timeUnit=HOURS) public void clearRacTokenServiceUserIdCache()