Interface TenantIdResolver

All Known Implementing Classes:
CompositeTenantIdResolver, JwtClaimTenantIdResolver, JwtDetailsTenantIdResolver, UserDetailsTenantIdResolver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TenantIdResolver

租戶 ID 解析策略介面

定義從 Spring Security Authentication 中解析租戶 ID 的策略。 不同的認證方式(OAuth2 JWT、本地 JWT、Basic Auth 等)可以實作此介面, 提供各自的租戶 ID 解析邏輯。

使用方式:

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    resolve(org.springframework.security.core.Authentication authentication)
    從認證資訊中解析租戶 ID
  • Method Details

    • resolve

      String resolve(org.springframework.security.core.Authentication authentication)
      從認證資訊中解析租戶 ID
      Parameters:
      authentication - Spring Security 認證物件,不為 null
      Returns:
      租戶 ID,若此 resolver 無法處理則返回 null