java.lang.Object
io.helidon.security.providers.idcs.mapper.IdcsRoleMapperRxProviderBase
io.helidon.security.providers.idcs.mapper.IdcsRoleMapperRxProvider
All Implemented Interfaces:
SecurityProvider, SubjectMappingProvider

public class IdcsRoleMapperRxProvider extends IdcsRoleMapperRxProviderBase implements SubjectMappingProvider
SubjectMappingProvider to obtain roles from IDCS server for a user. Supports multi tenancy in IDCS.
  • Constructor Details

  • Method Details

    • builder

      public static IdcsRoleMapperRxProvider.Builder<?> builder()
      Creates a new builder to build instances of this class.
      Returns:
      a new fluent API builder.
    • create

      public static SecurityProvider create(Config config)
      Creates an instance from configuration.

      Expects:

      • oidc-config to load an instance of OidcConfig
      • cache-config (optional) to load an instance of EvictableCache for role caching
      Parameters:
      config - configuration of this provider
      Returns:
      a new instance configured from config
    • enhance

      protected Single<Subject> enhance(ProviderRequest request, AuthenticationResponse previousResponse, Subject subject)
      Description copied from class: IdcsRoleMapperRxProviderBase
      Enhance subject with IDCS roles, reactive.
      Specified by:
      enhance in class IdcsRoleMapperRxProviderBase
      Parameters:
      request - provider request
      previousResponse - authenticated response
      subject - subject to enhance
      Returns:
      future with enhanced subject
    • computeGrants

      protected Single<List<? extends Grant>> computeGrants(Subject subject)
      Compute grants for the provided subject. This implementation gets grants from server getGrantsFromServer(io.helidon.security.Subject).
      Parameters:
      subject - to retrieve roles (or in general grants)
      Returns:
      future with grants to be added to the subject
    • addAdditionalGrants

      protected Single<List<? extends Grant>> addAdditionalGrants(Subject subject, List<Grant> idcsGrants)
      Extension point to add additional grants that are not retrieved from IDCS.
      Parameters:
      subject - subject to enhance
      idcsGrants - grants obtained from IDCS
      Returns:
      grants to add to the subject
    • getGrantsFromServer

      protected Single<List<? extends Grant>> getGrantsFromServer(Subject subject)
      Retrieves grants from IDCS server.
      Parameters:
      subject - to get grants for
      Returns:
      optional list of grants to be added