Class IdcsRoleMapperRxProviderBase
- java.lang.Object
- 
- io.helidon.security.providers.idcs.mapper.IdcsRoleMapperRxProviderBase
 
- 
- All Implemented Interfaces:
- SecurityProvider,- SubjectMappingProvider
 - Direct Known Subclasses:
- IdcsMtRoleMapperRxProvider,- IdcsRoleMapperRxProvider
 
 public abstract class IdcsRoleMapperRxProviderBase extends Object implements SubjectMappingProvider Common functionality for IDCS role mapping using reactiveWebClient.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classIdcsRoleMapperRxProviderBase.AppTokenRxReactive token for app access to IDCS.static classIdcsRoleMapperRxProviderBase.Builder<B extends IdcsRoleMapperRxProviderBase.Builder<B>>Fluent API builder forIdcsRoleMapperRxProviderBase.
 - 
Field SummaryFields Modifier and Type Field Description protected static StringACCESS_TOKEN_KEYJson key for token to be retrieved from IDCS response when requesting application token.static StringIDCS_SUBJECT_TYPE_CLIENTClient subject type used when requesting roles from IDCS.static StringIDCS_SUBJECT_TYPE_USERUser subject type used when requesting roles from IDCS.protected static StringPARENT_CONTEXT_CLIENT_PROPERTYProperty sent with JAX-RS requests to override parent span context in outbound calls.protected static StringROLE_APPROLEJson key for app roles to be retrieved from IDCS response.protected static StringROLE_GROUPJson key for group roles to be retrieved from IDCS response.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedIdcsRoleMapperRxProviderBase(IdcsRoleMapperRxProviderBase.Builder<?> builder)Configures the needed fields from the provided builder.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected SubjectbuildSubject(Subject originalSubject, List<? extends Grant> grants)Updates original subject with the list of grants.protected StringdefaultIdcsSubjectType()Default subject type to use when requesting data from IDCS.protected abstract Single<Subject>enhance(ProviderRequest request, AuthenticationResponse previousResponse, Subject subject)Enhance subject with IDCS roles, reactive.Single<AuthenticationResponse>map(ProviderRequest authenticatedRequest, AuthenticationResponse previousResponse)Map grants from authenticated request (e.g.protected OidcConfigoidcConfig()Access toOidcConfigso the field is not duplicated by classes that extend this provider.protected Single<List<? extends Grant>>processRoleRequest(WebClientRequestBuilder request, Object entity, String subjectName)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface io.helidon.security.spi.SecurityProvidersupportedAnnotations, supportedAttributes, supportedConfigKeys, supportedCustomObjects
 
- 
 
- 
- 
- 
Field Detail- 
IDCS_SUBJECT_TYPE_USERpublic static final String IDCS_SUBJECT_TYPE_USER User subject type used when requesting roles from IDCS. An attempt is made to obtain it from JWT claimsub_type. If not defined, default is used as configured inIdcsRoleMapperRxProviderBase.Builder.- See Also:
- Constant Field Values
 
 - 
IDCS_SUBJECT_TYPE_CLIENTpublic static final String IDCS_SUBJECT_TYPE_CLIENT Client subject type used when requesting roles from IDCS. An attempt is made to obtain it from JWT claimsub_type. If not defined, default is used as configured inIdcsRoleMapperRxProviderBase.Builder.- See Also:
- Constant Field Values
 
 - 
ROLE_GROUPprotected static final String ROLE_GROUP Json key for group roles to be retrieved from IDCS response.- See Also:
- Constant Field Values
 
 - 
ROLE_APPROLEprotected static final String ROLE_APPROLE Json key for app roles to be retrieved from IDCS response.- See Also:
- Constant Field Values
 
 - 
ACCESS_TOKEN_KEYprotected static final String ACCESS_TOKEN_KEY Json key for token to be retrieved from IDCS response when requesting application token.- See Also:
- Constant Field Values
 
 - 
PARENT_CONTEXT_CLIENT_PROPERTYprotected static final String PARENT_CONTEXT_CLIENT_PROPERTY Property sent with JAX-RS requests to override parent span context in outbound calls. We cannot use the constant declared inClientTracingFilter, as it is not a required dependency.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
IdcsRoleMapperRxProviderBaseprotected IdcsRoleMapperRxProviderBase(IdcsRoleMapperRxProviderBase.Builder<?> builder) Configures the needed fields from the provided builder.- Parameters:
- builder- builder with oidcConfig and other needed fields.
 
 
- 
 - 
Method Detail- 
mappublic Single<AuthenticationResponse> map(ProviderRequest authenticatedRequest, AuthenticationResponse previousResponse) Description copied from interface:SubjectMappingProviderMap grants from authenticated request (e.g. one or both ofProviderRequest.subject()orProviderRequest.service()returns a non-empty value) to a new authentication response. The provider can change/add/remove grants (such as groups, scopes, permissions) or change the subject to a different one. This method is only invoked after a successful authentication.- Specified by:
- mapin interface- SubjectMappingProvider
- Parameters:
- authenticatedRequest- request to get user and service subjects from
- previousResponse- response from previous authentication or subject mapping provider
- Returns:
- a new authentication response with updated user and/or service subjects
 
 - 
enhanceprotected abstract Single<Subject> enhance(ProviderRequest request, AuthenticationResponse previousResponse, Subject subject) Enhance subject with IDCS roles, reactive.- Parameters:
- request- provider request
- previousResponse- authenticated response
- subject- subject to enhance
- Returns:
- future with enhanced subject
 
 - 
buildSubjectprotected Subject buildSubject(Subject originalSubject, List<? extends Grant> grants) Updates original subject with the list of grants.- Parameters:
- originalSubject- as was created by authentication provider
- grants- grants added by this role mapper
- Returns:
- new subject
 
 - 
processRoleRequestprotected Single<List<? extends Grant>> processRoleRequest(WebClientRequestBuilder request, Object entity, String subjectName) 
 - 
oidcConfigprotected OidcConfig oidcConfig() Access toOidcConfigso the field is not duplicated by classes that extend this provider.- Returns:
- open ID Connect configuration (also used to configure access to IDCS)
 
 - 
defaultIdcsSubjectTypeprotected String defaultIdcsSubjectType() Default subject type to use when requesting data from IDCS.- Returns:
- configured default subject type or IDCS_SUBJECT_TYPE_USER
 
 
- 
 
-