Bug 6278 - SecurityContextFactory loads wrong implementation
: SecurityContextFactory loads wrong implementation
Status: RESOLVED FIXED
: GridShib
SAML/Binding Tools
: 0.5
: All All
: P3 normal
: beta
Assigned To:
:
:
: 6194
: 6269
  Show dependency treegraph
 
Reported: 2008-07-31 06:59 by
Modified: 2008-07-31 15:40 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-07-31 06:59:19
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.
------- Comment #1 From 2008-07-31 08:19:02 -------
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.
------- Comment #2 From 2008-07-31 08:23:28 -------
In SecurityContextFactory, get the configured impl from BootstrapConfigLoader
and load that if not null; otherwise load the default impl.
------- Comment #3 From 2008-07-31 08:24:41 -------
Committed BootstrapConfigLoader and SecurityContextFactory to CVS HEAD.  This
patch will be distributed with GS-ST v0.5.0.
------- Comment #4 From 2008-07-31 14:57:45 -------
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)
------- Comment #5 From 2008-07-31 15:04:28 -------
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.
------- Comment #6 From 2008-07-31 15:40:28 -------
Committed new versions of BootstrapConfigLoader and SecurityContextFactory to
CVS HEAD.