Class OidcProvider.Builder
- java.lang.Object
-
- io.helidon.security.providers.oidc.OidcProvider.Builder
-
- All Implemented Interfaces:
Builder<OidcProvider>
,Supplier<OidcProvider>
- Enclosing class:
- OidcProvider
public static final class OidcProvider.Builder extends Object implements Builder<OidcProvider>
Builder forOidcProvider
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OidcProvider.Builder
addTenantConfigFinder(TenantConfigFinder configFinder)
Add specificTenantConfigFinder
implementation.OidcProvider.Builder
addTenantConfigFinder(TenantConfigFinder configFinder, int priority)
Add specificTenantConfigFinder
implementation with specific priority.OidcProvider.Builder
addTenantConfigFinder(TenantIdFinder idFinder)
Add specificTenantIdFinder
implementation.OidcProvider.Builder
addTenantConfigFinder(TenantIdFinder idFinder, int priority)
Add specificTenantIdFinder
implementation with specific priority.OidcProvider
build()
Build the instance from this builder.OidcProvider.Builder
config(Config config)
Update this builder with configuration.OidcProvider.Builder
discoverTenantConfigProviders(boolean discoverConfigProviders)
Whether to allowTenantConfigProvider
service loader discovery.OidcProvider.Builder
discoverTenantIdProviders(boolean discoverIdProviders)
Whether to allowTenantIdFinder
service loader discovery.OidcProvider.Builder
oidcConfig(OidcConfig config)
Configuration of OIDC (Open ID Connect).OidcProvider.Builder
optional(boolean optional)
Whether authentication is required.OidcProvider.Builder
outboundConfig(OutboundConfig config)
Configuration of outbound rules.OidcProvider.Builder
propagate(boolean propagate)
Whether to propagate identity.OidcProvider.Builder
useJwtGroups(boolean useJwtGroups)
Claimgroups
from JWT will be used to automatically add groups to current subject (may be used withRolesAllowed
annotation).
-
-
-
Method Detail
-
build
public OidcProvider build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<OidcProvider>
- Returns:
- instance of the built type
-
config
public OidcProvider.Builder config(Config config)
Update this builder with configuration. Only updates information that was not explicitly set. The following configuration options are used:Optional configuration parameters key default value description The current config node is used to construct OidcConfig
.propagate false Whether to propagate token (overall configuration). If set to false, propagation will not be done at all. outbound Configuration of OutboundConfig
. In addition you can usepropagate
to disable propagation for an outbound target, andtoken
to configure outboundTokenHandler
for an outbound target. Default token handler usesAuthorization
header with abearer
prefix- Parameters:
config
- OIDC provider configuration- Returns:
- updated builder instance
-
propagate
public OidcProvider.Builder propagate(boolean propagate)
Whether to propagate identity.- Parameters:
propagate
- whether to propagate identity (true) or not (false)- Returns:
- updated builder instance
-
outboundConfig
public OidcProvider.Builder outboundConfig(OutboundConfig config)
Configuration of outbound rules.- Parameters:
config
- outbound configuration- Returns:
- updated builder instance
-
oidcConfig
public OidcProvider.Builder oidcConfig(OidcConfig config)
Configuration of OIDC (Open ID Connect).- Parameters:
config
- OIDC configuration for this provider- Returns:
- updated builder instance
-
optional
public OidcProvider.Builder optional(boolean optional)
Whether authentication is required. By default, request will fail if the authentication cannot be verified. If set to true, request will process and this provider will abstain.- Parameters:
optional
- whether authentication is optional (true) or required (false)- Returns:
- updated builder instance
-
useJwtGroups
public OidcProvider.Builder useJwtGroups(boolean useJwtGroups)
Claimgroups
from JWT will be used to automatically add groups to current subject (may be used withRolesAllowed
annotation).- Parameters:
useJwtGroups
- whether to usegroups
claim from JWT to retrieve roles- Returns:
- updated builder instance
-
discoverTenantConfigProviders
public OidcProvider.Builder discoverTenantConfigProviders(boolean discoverConfigProviders)
Whether to allowTenantConfigProvider
service loader discovery. Default value istrue
.- Parameters:
discoverConfigProviders
- whether to use service loader- Returns:
- updated builder instance
-
discoverTenantIdProviders
public OidcProvider.Builder discoverTenantIdProviders(boolean discoverIdProviders)
Whether to allowTenantIdFinder
service loader discovery. Default value istrue
.- Parameters:
discoverIdProviders
- whether to use service loader- Returns:
- updated builder instance
-
addTenantConfigFinder
public OidcProvider.Builder addTenantConfigFinder(TenantConfigFinder configFinder)
Add specificTenantConfigFinder
implementation. PriorityBUILDER_PRIORITY
is used.- Parameters:
configFinder
- config finder implementation- Returns:
- updated builder instance
-
addTenantConfigFinder
public OidcProvider.Builder addTenantConfigFinder(TenantConfigFinder configFinder, int priority)
Add specificTenantConfigFinder
implementation with specific priority.- Parameters:
configFinder
- config finder implementationpriority
- finder priority- Returns:
- updated builder instance
-
addTenantConfigFinder
public OidcProvider.Builder addTenantConfigFinder(TenantIdFinder idFinder)
Add specificTenantIdFinder
implementation. PriorityBUILDER_PRIORITY
is used.- Parameters:
idFinder
- id finder implementation- Returns:
- updated builder instance
-
addTenantConfigFinder
public OidcProvider.Builder addTenantConfigFinder(TenantIdFinder idFinder, int priority)
Add specificTenantIdFinder
implementation with specific priority.- Parameters:
idFinder
- id finder implementationpriority
- finder priority- Returns:
- updated builder instance
-
-