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

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

  • Method Details

    • builder

      public static IdcsRoleMapperProvider.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 Subject enhance(ProviderRequest request, AuthenticationResponse previousResponse, Subject subject)
      Description copied from class: IdcsRoleMapperProviderBase
      Enhance subject with IDCS roles, reactive.
      Specified by:
      enhance in class IdcsRoleMapperProviderBase
      Parameters:
      request - provider request
      previousResponse - authenticated response
      subject - subject to enhance
      Returns:
      future with enhanced subject
    • computeGrants

      protected 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 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 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