Bugzilla – Bug 6278
SecurityContextFactory loads wrong implementation
Last modified: 2008-07-31 15:40:28
You need to log in before you can comment on or make changes to this bug.
By default, SecurityContextFactory loads implementation "org.globus.gridshib.security.SAMLSecurityContext", which of course works fine for GS-ST, but other applications (such as GS4GT) may wish to configure a different default. Since BootstrapConfigLoader now loads an optional SecurityContextImpl bootstrap property (Bug 6194), this should be possible.
In BootstrapConfigLoader, load the SecurityContextImpl bootstrap property, test to make sure the class exists, but do not call the setSecurityContextImpl method in SecurityContextFactory. Instead provide a getSecurityContextImpl method and let SecurityContextFactory set the impl itself.
In SecurityContextFactory, get the configured impl from BootstrapConfigLoader and load that if not null; otherwise load the default impl.
Committed BootstrapConfigLoader and SecurityContextFactory to CVS HEAD. This patch will be distributed with GS-ST v0.5.0.
Commenting out this line in GridShibSecurityTest //ExtSecurityContext.init(); causes this NPE: Testcase: testGridShibSecurity took 1.362 sec Caused an ERROR null java.lang.NullPointerException at org.globus.gridshib.security.SecurityContextFactory.getInstance(SecurityContextFactory.java:201) at org.globus.gridshib.security.SecurityContextFactory.getInstance(SecurityContextFactory.java:144) at org.globus.gridshib.security.GridShibSecurityTest.consumeX509BoundSAML(GridShibSecurityTest.java:389) at org.globus.gridshib.security.GridShibSecurityTest.testGridShibSecurity(GridShibSecurityTest.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
The problem was due to the position of the static initializer, which caused two static variables to be clobbered. Relocated the initializer and the problem went away.
Committed new versions of BootstrapConfigLoader and SecurityContextFactory to CVS HEAD.