Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile is null on non-integrated node js application #54

Open
mnavidad opened this issue Jun 19, 2018 · 4 comments
Open

profile is null on non-integrated node js application #54

mnavidad opened this issue Jun 19, 2018 · 4 comments

Comments

@mnavidad
Copy link

mnavidad commented Jun 19, 2018

Hi
We have a node js application using passport-windowsauth for ldap, the code is set up to also use a form.
here is the code
nodeappcodepng

js code
jscodenode

when we run the application the profile is null and I do not know why,
the application is running on express server however we use IIS as a passthrough using ARR.
I'm looking to see if someone can shed a light to this issue or point me in the right direction to see why this is not working

Thank you so much!

@newmanw
Copy link

newmanw commented May 18, 2019

Seeing the same thing.

Looks like this has been sitting for a while, any ideas?

@marce2509
Copy link

I have the same problem. profile is null

@jg76379
Copy link

jg76379 commented Sep 20, 2019

I had the same issue and I found that it was because the default ldap query was not correct for our ldap configuration.

However, The strategy accepts a search_query argument (although this does not seem to be documented anywhere):

The passport-windowsauth LdapLookup.js shows the following:

this._search_query = options.search_query || '(&(objectclass=user)(|(sAMAccountName={0})(UserPrincipalName={0})))';

To get the strategy to work with our ldap I had to modify the query to search for "cn" instead of "UserPrincipalName". This is how you pass in the argument:

var passport = require("passport");
var WindowsStrategy = require("passport-windowsauth");
// ...
// Init passport strategy
passport.use(new WindowsStrategy({
    ldap: {
        url: ldapUrl,
        base: ldapBase,
        bindDN: ldapBindUN,
        bindCredentials: ldapBindPW,
        search_query: "(&(objectclass=user)(|(sAMAccountName={0})(cn={0})))"
    },
    integrated: false
}

@mnavidad
Copy link
Author

mnavidad commented Oct 9, 2019

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants