Class OidcKeyService

java.lang.Object
io.skipcheck.tm1.client.service.security.OidcKeyService

public final class OidcKeyService extends Object
The OpenID Connect signing keys TM1 has cached, for servers that check OIDC tokens themselves. Removing a key makes TM1 fetch it from the provider again, as after the provider rotates its keys. On a server that checks no tokens, the cache is empty.

Refresh the cache after the provider rotates its keys:

// After the provider rotates its signing keys: drop every cached key, so TM1
// fetches them again
return tm1.oidcKeys().keys().collectList().flatMap(keys -> tm1.oidcKeys().remove(keys));
  • Constructor Details

    • OidcKeyService

      public OidcKeyService(Tm1Session session)
      A service sending its requests through session.
      Parameters:
      session - the session
  • Method Details

    • keys

      @Tm1Endpoint("FunctionImport GetOIDCKeys") public reactor.core.publisher.Flux<String> keys()
      GetOIDCKeys(), streamed: the IDs of the cached keys.
      Returns:
      the key IDs
    • remove

      @Tm1Endpoint("ActionImport RemoveOIDCKeyFromCache") public reactor.core.publisher.Mono<Void> remove(List<String> keyIds)
      RemoveOIDCKeyFromCache: drops keys from the cache. A key TM1 hasn't cached fails the call with a Tm1NotFoundException: TM1 answers 400 with ObjectNotFound (code 55), which the client reads as not found. An empty list does nothing.
      Parameters:
      keyIds - the keys' IDs
      Returns:
      completes when they're dropped