jlguenego / node-expose-sspi

Expose Microsoft Windows SSPI to Node for SSO authentication.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing adUser property in the user object

lastapella opened this issue · comments

Hi first of all thank you for this module, the documentation and examples has helped me a lot.

Describe the bug
The issue I have is when using the sso.auth() middleware, the req.sso object doesn't contain the adUser object anymore. We plan to use the userPrincipalName property to link it with application user. I notice this object was there previously by running the react example, but in the latest versions it is not present
Is this removal was intentional and if so is there a possibility to get access to this object again?

To Reproduce

Run the react example from https://github.com/jlguenego/react-sso-example, or install the version 0.1.3. This would have the adUser property. While running one of the latest version (0.1.4x) this property is not there anymore.

The code for the middleware :

  app.get('/api/auth/authenticated', sso.auth(), async (req, res) => {
    if (!req.sso) {
      return res.status(401).end();
    }
    return res.json({
      sso: req.sso
    });
  });

Environment version:

  • OS: Windows 10 Pro version 1903 x64
  • Browser version: Chrome / Edge
  • Node version and architecture: 12.18.2 64bits

Please indicates also:

  • Are you on a Windows domain ? yes
  • Can you reach the domain controller ? yes
  • Do your session have admin privileges ? no
  • Which authentication protocol ? NTLM for now, Kerberos later
  • Active Directory, or local window policies that could impact the authentication.

Please first upgrade to latest version. 0.1.45 and check again the whole req.sso object.
Note that if you are on a domain, but the domain controller cannot be reached, the server will not be able to get the adUser object.

Thanks for the quick reply.

My issue is that I have the adUSer object using the version 0.1.3, but when using 0.1.45 version it is not there anymore.
As I have this object using the older version I assume the domain controller can be reached, so I don't figure out why I don't have it with the latest version.
How can I verify that I actually reach the domain controller?