Interface TokenValidable<U extends DecryptableContent,T extends EncryptedContentBearer<U>>

Type Parameters:
U - The type of the decryptable content
T - The type of the bearer of the encrypted content

public interface TokenValidable<U extends DecryptableContent,T extends EncryptedContentBearer<U>>
TokenValidable interface
  • Field Details

    • graphNotificationPublisher

      static final String graphNotificationPublisher
      Graph notification publisher. Ensures that a different app that isn't Microsoft Graph did not send the change notifications
      See Also:
  • Method Details

    • setValidationTokens

      void setValidationTokens(@Nullable List<String> validationTokens)
      Sets collection of validation tokens
      Parameters:
      validationTokens - tokens
    • getValidationTokens

      @Nullable List<String> getValidationTokens()
      Returns validation tokens
      Returns:
      list of tokens
    • setValue

      void setValue(@Nullable List<T> value)
      Sets collection of encrypted token bearers
      Parameters:
      value - collection of encrypted token bearers
    • getValue

      @Nullable List<T> getValue()
      Get collection of encrypted token bearers
      Returns:
      encrypted token bearers
    • areTokensValid

      static <U extends DecryptableContent, T extends EncryptedContentBearer<U>> boolean areTokensValid(@Nonnull TokenValidable<U,T> collection, @Nonnull List<UUID> tenantIds, @Nonnull List<UUID> appIds, @Nonnull String keyDiscoveryUrl)
      Validates the tokens
      Type Parameters:
      U - DecryptableContent
      T - EncryptedContentBearer
      Parameters:
      collection - collection of encrypted token bearers
      tenantIds - tenant ids
      appIds - app ids
      keyDiscoveryUrl - the JWKS endpoint to use to retrieve signing keys
      Returns:
      true if the tokens are valid
      Throws:
      IllegalArgumentException - if one of the tokens are invalid
    • areTokensValid

      static <U extends DecryptableContent, T extends EncryptedContentBearer<U>> boolean areTokensValid(@Nonnull TokenValidable<U,T> collection, @Nonnull List<UUID> tenantIds, @Nonnull List<UUID> appIds)
      Validates the tokens
      Type Parameters:
      U - DecryptableContent
      T - EncryptedContentBearer
      Parameters:
      collection - collection of encrypted token bearers
      tenantIds - tenant ids
      appIds - app ids
      Returns:
      true if the tokens are valid
    • isTokenValid

      static <U extends DecryptableContent, T extends EncryptedContentBearer<U>> boolean isTokenValid(@Nonnull String token, @Nonnull List<UUID> tenantIds, @Nonnull List<UUID> appIds, @Nonnull String keyDiscoveryUrl)
      Validates the token
      Type Parameters:
      U - DecryptableContent
      T - EncryptedContentBearer
      Parameters:
      token - token
      tenantIds - tenant ids
      appIds - app ids
      keyDiscoveryUrl - the JWKS endpoint to use to retrieve signing keys
      Returns:
      true if the token is valid
      Throws:
      IllegalArgumentException - if the token is invalid