Interface IdmQueryService

All Known Subinterfaces:
IdmService

public interface IdmQueryService
Interface for querying an IDM service (e.g. via LDAP).
An implementation can be configured via Spring @Value binding or by injecting swiss.trustbroker.config.TrustbrokerProperties and using swiss.trustbroker.config.dto.IdmConfig (${trustbroker.config.idm}).
Breaking changes:
  • With 1.8.0 getAttributesFromIdm renamed to getAttributes.
  • With 1.15.0 getAttributes and getAttributesAudited were changed to a single IdmRequest as input and state was added for implementations that need state across requests.
  • Method Details

    • getAttributes

      boolean getAttributes(RelyingPartyConfig relyingPartyConfig, CpResponseData cpResponse, IdmRequest idmRequest, IdmStatusPolicyCallback statusPolicyCallback, Map<String,Object> state, IdmResult result)
      Parameters:
      relyingPartyConfig - Data from the request (not null)
      cpResponse - Data from the CP response (not null)
      idmRequest - Defines the request to be performed by this call to query the IDM.
      The request is for this service.
      statusPolicyCallback - callback for status policy enforcement
      state - State that can be used by this service across a set of related requests.
      result - Update with this query's result. Changing exising results is allowed.
      Returns:
      true if the query was processed, false otherwise
      Since:
      1.8.0
    • getAttributesAudited

      default boolean getAttributesAudited(RelyingPartyConfig relyingPartyConfig, CpResponseData cpResponse, IdmRequest idmRequest, IdmStatusPolicyCallback statusPolicyCallback, Map<String,Object> state, IdmResult result)
      Implements getAttributes as well but signals, that the IDM data is fetched based on a federated login for the first time and therefore might need additional auditing (write operations on an otherwise read-only access).
      Since:
      1.8.0
    • getClientExtId

      default Optional<String> getClientExtId(IdmRequests idmRequests)
      Parameters:
      idmRequests - Defines the requests to be performed by the call to query the IDM.
      Returns:
      Client external ID if defined in IdmRequests and relevant for this service.
    • hasQueryOfStore

      default boolean hasQueryOfStore(String requestedStore, IdmRequests idmRequests, String defaultStore)
      Parameters:
      requestedStore - Defines the store requesting this check
      idmRequests - Defines the requests to be performed by this call to query the store.
      defaultStore - Default store of the application
      Returns:
      boolean whether those requests are interesting for this store.
    • isQueryOfStore

      default boolean isQueryOfStore(String requestedStore, IdmRequest idmQuery, String defaultStore)
      Parameters:
      requestedStore - Defines the store requesting this check
      idmQuery - Defines the request to be performed by this call to query the store.
      defaultStore - Default store of the application
      Returns:
      boolean whether this particular request is interesting for this store.
    • getServiceDefaultOrder

      Integer getServiceDefaultOrder()
      Returns:
      the default order used by the service to determine the IdmRequest> order when no explicit order is set
      Since:
      1.15.0
    • getStoreName

      String getStoreName()
      Returns:
      the IdmStore name use to assign the correct IdmService to the IdmRequest
      Since:
      1.15.0
    • sortQueriesByName

      default boolean sortQueriesByName()
      Returns:
      true if the IdmRequest should be sorted by name when no explicit order is provided.
      Default: false
      Since:
      1.15.0