[java-identity-provider COMMIT] /trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnC...

noreply at shibboleth.net noreply at shibboleth.net
Mon Oct 26 12:59:59 EDT 2015


Author: scantor
Date: Mon Oct 26 12:59:59 2015
New Revision: 7880

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7880&view=rev
Log:
Patch from Daniel Lutz to support unit tests.

Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java?rev=7880&r1=7879&r2=7880&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java	(original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnController.java	Mon Oct 26 12:59:59 2015
@@ -136,7 +136,7 @@
         GSSContextAcceptor acceptor = spnegoCtx.getContextAcceptor();
         if (acceptor == null) {
             try {
-                acceptor = new GSSContextAcceptor(spnegoCtx.getKerberosSettings());
+                acceptor = createGSSContextAcceptor(spnegoCtx);
                 spnegoCtx.setContextAcceptor(acceptor);
             } catch (final GSSException e) {
                 log.error("Unable to create GSSContextAcceptor", e);
@@ -298,7 +298,20 @@
         final AuthenticationContext authnContext = prc.getSubcontext(AuthenticationContext.class);
         return authnContext != null ? authnContext.getSubcontext(SPNEGOContext.class) : null;
     }
-    
+
+    /**
+     * Create a new {@link GSSContextAcceptor} object.
+     * (Created in a separate method to support unit testing.)
+     * 
+     * @param spnegoCtx the {@link SPNEGOContext} conteining the {@link KerberosSettings}
+     * @return a new {@link GSSContextAcceptor}
+     * @throws GSSException if an error occurs while creating the {@link GSSContextAcceptor}.
+     */
+    @Nonnull
+    protected GSSContextAcceptor createGSSContextAcceptor(@Nonnull final SPNEGOContext spnegoCtx) throws GSSException {
+        return new GSSContextAcceptor(spnegoCtx.getKerberosSettings());
+    }
+
     /**
      * Send back an empty Negotiate challenge.
      * 



More information about the commits mailing list