Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5275

NullPointerException when using Kerberos Delegation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.6
    • 2.6.10
    • Core
    • None
    • Unknown

    Description

      We are on Jboss 6.1.0 the version of CXF is 2.6.6 and has a bug when delegation is used:

      AbstractSpnegoAuthSupplier (v 2.6.6) has this method call:

      [...]
      return getToken(delegatedCred == null ? authPolicy : null, context);
      [...]

      here if we have delegatedCred with a value the statment passes null to the method:

      private byte[] getToken(AuthorizationPolicy authPolicy,
      final GSSContext context) throws GSSException,
      LoginException {

      String contextName = authPolicy.getAuthorization();
      if (contextName == null)

      { contextName = ""; }

      [...]
      }

      if authPolicy is null (our case) the method throws a NullPointerException.

      So I got the fixed AbstractSpnegoAuthSupplier and SpnegoAuthSupplier from cxf 2.7.1 copied/renamed in my project and programmatically set on HTTPConduit:

      [...]
      HTTPConduit http = (HTTPConduit) client.getConduit();
      http.setAuthorization(authorization);
      http.setAuthSupplier(new CustomSpnegoAuthSupplier());
      [...]

      And now it works fine.

      Attachments

        Activity

          People

            coheigea Colm O hEigeartaigh
            mmusaji mustafa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: