Uploaded image for project: 'Single Sign On'
  1. Single Sign On
  2. MGNLSSO-188

Refresh SSO config when loaded through the YAML bridge

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 3.1.0, saas
    • 3.0.0
    • None
    • None
    • AdminX 25, AdminX 26 Xmas & New year, AdminX 27, AdminX 28
    • 5

      Context

      Intermittently, some PaaS instances could not start up successfully because it could not load the expected resource at /magnolia-sso/config.yaml. See the trace below
      (side note: even if magnolia started up successfully, users would not be able to log in).

      Root cause is unknown at this point, might be a race condition with light-module sync, nonetheless we may take some steps to mitigate the issue.

      Currently, SSO config is not reloaded in v3.

      Also, the "bridge" config path (noted above) overlaps with the module config decoration mechanism. As a result, while the typical resource-loading logs may appear (with or without definition problems), we assume this doesn't affect the SsoModule class itself, and the SsoConfigYamlBridge does not depend on this mechanism.

      Considered options

      • Load SSO config more lazily (not directly upon startup)
      • Reload SSO config by observing the resource origin for config.yaml changes (potential sync issues might cure themselves without a restart?)
      • Break away from the old module-config & decoration mechanism in v3. I'd propose we rename the magnolia module to just "sso" in module descriptor, to make sure the /magnolia-sso/config.yaml file is not attempted to be loaded by the module config registry, but only by the SSO bridge.

      Stack trace

      [ERROR] info.magnolia.cms.filters.ServletDispatchingFilter: Unable to load servlet class info.magnolia.sso.SsoCallbackServlet : Failed to create instance of [class info.magnolia.sso.SsoCallbackServlet]
      info.magnolia.objectfactory.MgnlInstantiationException: Failed to create instance of [class info.magnolia.sso.SsoCallbackServlet]
          at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstanceWithParameterResolvers(GuiceComponentProvider.java:138) ~[magnolia-core-6.2.24.jar:?]
      ...
      Caused by: info.magnolia.objectfactory.MgnlInstantiationException: Failed to resolve param [0] of type [class info.magnolia.sso.config.Pac4jConfigProvider]
          at info.magnolia.objectfactory.ObjectManufacturer.resolveParameters(ObjectManufacturer.java:146) ~[magnolia-core-6.2.24.jar:?]
      ...
      Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
      1) Error injecting constructor, info.magnolia.sso.config.SsoConfigurationException: Failed to load SSO config from path [/magnolia-sso/config.yaml]
          at info.magnolia.sso.config.Pac4jConfigProvider.(Pac4jConfigProvider.java:79)
          at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindImplementation(GuiceComponentConfigurationModule.java:160) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
      ...
      Caused by: info.magnolia.sso.config.SsoConfigurationException: Failed to load SSO config from path [/magnolia-sso/config.yaml]
          at info.magnolia.sso.config.SsoConfigYamlBridge.get(SsoConfigYamlBridge.java:77) ~[magnolia-sso-3.0.0.jar:?]
          at info.magnolia.sso.config.Pac4jConfigProvider.(Pac4jConfigProvider.java:81) ~[magnolia-sso-3.0.0.jar:?]
          at info.magnolia.sso.config.Pac4jConfigProvider$$FastClassByGuice$$cad0476c.newInstance() ~[magnolia-sso-3.0.0.jar:?]
      ...
      Caused by: info.magnolia.resourceloader.ResourceOrigin$ResourceNotFoundException: No resource found for path /magnolia-sso/config.yaml in origin layered
          at info.magnolia.resourceloader.layered.LayeredResourceOrigin.getByPath(LayeredResourceOrigin.java:114) ~[magnolia-resource-loader-6.2.24.jar:?]
          at info.magnolia.resourceloader.layered.LayeredResourceOrigin.getByPath(LayeredResourceOrigin.java:72) ~[magnolia-resource-loader-6.2.24.jar:?]
          at info.magnolia.sso.config.SsoConfigYamlBridge.get(SsoConfigYamlBridge.java:74) ~[magnolia-sso-3.0.0.jar:?]
          at info.magnolia.sso.config.Pac4jConfigProvider.(Pac4jConfigProvider.java:81) ~[magnolia-sso-3.0.0.jar:?]
          at info.magnolia.sso.config.Pac4jConfigProvider$$FastClassByGuice$$cad0476c.newInstance() ~[magnolia-sso-3.0.0.jar:?]
      ...
      

        Acceptance criteria

              nguyen.phung Nguyen Phung Chi
              mgeljic Mikaël Geljić
              AdminX
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 11d 1h
                    11d 1h