Package net.datenwerke.oidc.server
Class OidcConfigurationService
java.lang.Object
net.datenwerke.oidc.server.OidcConfigurationService
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides access to constants and validated OIDC-related configuration properties required for application startup.
Property keys correspond to entries in the reportserver.properties configuration file
used to configure authentication mode, OAuth2 client registration,
and provider metadata.
Implementations of this interface read configuration values from the underlying
reportserver.properties configuration file and ensure that
required properties are present and valid.
NullPointerException or other runtime exceptions.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOidcConfigurationService(ApplicationPropertiesService propertiesService) Creates an OidcConfigurationServiceImpl using the given properties service. -
Method Summary
Modifier and TypeMethodDescriptionReturns the property key used to map the username claim from the OIDC token to the corresponding ReportServer user.Returns the validated authentication mode.Returns the validated OAuth2 client ID for the configured client provider.Returns the validated OAuth2 client provider.Returns the validated OAuth2 client secret for the configured client provider.Returns the validated issuer URI for the configured client provider.Returns the validated web client ID for the configured client provider.Returns the validated web client issuer URI for the configured client provider.
-
Field Details
-
AUTHENTICATION_MODE_PROPERTY_NAME
- See Also:
-
OAUTH2_CLIENT_PROVIDER_PROPERTY_NAME
- See Also:
-
OAUTH2_CLIENT_REGISTRATION_PROPERTY_NAME
- See Also:
-
OAUTH2_WEB_CLIENT_REGISTRATION_PROPERTY_NAME
- See Also:
-
OAUTH2_WEB_PROVIDER_PROPERTY_NAME
- See Also:
-
CLAIM_USERNAME_PROPERTY_NAME
- See Also:
-
CLIENT_ID_PROPERTY_NAME
- See Also:
-
CLIENT_SECRET_PROPERTY_NAME
- See Also:
-
ISSUER_URI_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
OidcConfigurationService
Creates an OidcConfigurationServiceImpl using the given properties service.The
ApplicationPropertiesServiceis used to read OIDC-related configuration from the reportserver.properties configuration file. Theannotation allows Guice to provide this dependency automatically.invalid reference
Inject- Parameters:
propertiesService- service to read configuration from reportserver.properties
-
-
Method Details
-
getValidatedAuthenticationMode
Returns the validated authentication mode.- Returns:
- the
Moderepresenting the configured authentication mode - Throws:
NullPointerException- if the property is not setIllegalArgumentException- if the property value is invalid
-
getValidatedClientProvider
Returns the validated OAuth2 client provider.- Returns:
- the configured client provider
- Throws:
NullPointerException- if the property is not set
-
getValidatedClientId
Returns the validated OAuth2 client ID for the configured client provider.- Returns:
- the client ID
- Throws:
NullPointerException- if the property is not set
-
getValidatedClientSecret
Returns the validated OAuth2 client secret for the configured client provider.- Returns:
- the client secret
- Throws:
NullPointerException- if the property is not set
-
getValidatedIssuerUri
Returns the validated issuer URI for the configured client provider.- Returns:
- the issuer URI
- Throws:
NullPointerException- if the property is not set
-
getValidatedWebClientId
Returns the validated web client ID for the configured client provider.- Returns:
- the web client ID
- Throws:
NullPointerException- if the property is not set
-
getValidatedWebIssuerUri
Returns the validated web client issuer URI for the configured client provider.- Returns:
- the web client issuer URI
- Throws:
NullPointerException- if the property is not set
-
getClaimUsernameKey
Returns the property key used to map the username claim from the OIDC token to the corresponding ReportServer user.This value is read from
reportserver.properties, e.g.:rs.security.oauth2.claim.username = preferred_username
If the property is not set, the default key"preferred_username"is used.- Returns:
- the claim key used to extract the username from the OIDC token.
-