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.

public class OidcConfigurationService extends Object
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.

If any required property is missing or invalid, the methods will throw NullPointerException or other runtime exceptions.
  • Field Details

  • Constructor Details

    • OidcConfigurationService

      public OidcConfigurationService(ApplicationPropertiesService propertiesService)
      Creates an OidcConfigurationServiceImpl using the given properties service.

      The ApplicationPropertiesService is used to read OIDC-related configuration from the reportserver.properties configuration file. The

      invalid reference
      Inject
      annotation allows Guice to provide this dependency automatically.
      Parameters:
      propertiesService - service to read configuration from reportserver.properties
  • Method Details

    • getValidatedAuthenticationMode

      public Mode getValidatedAuthenticationMode()
      Returns the validated authentication mode.
      Returns:
      the Mode representing the configured authentication mode
      Throws:
      NullPointerException - if the property is not set
      IllegalArgumentException - if the property value is invalid
    • getValidatedClientProvider

      public String getValidatedClientProvider()
      Returns the validated OAuth2 client provider.
      Returns:
      the configured client provider
      Throws:
      NullPointerException - if the property is not set
    • getValidatedClientId

      public String 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

      public String 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

      public String getValidatedIssuerUri()
      Returns the validated issuer URI for the configured client provider.
      Returns:
      the issuer URI
      Throws:
      NullPointerException - if the property is not set
    • getValidatedWebClientId

      public String 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

      public String 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

      public String 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.