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

Not able to make it work with koajs #26

Open
skeep opened this issue Jun 19, 2015 · 0 comments
Open

Not able to make it work with koajs #26

skeep opened this issue Jun 19, 2015 · 0 comments

Comments

@skeep
Copy link

skeep commented Jun 19, 2015

I am not able to make it work with koajs.

Below are the relevant code.

in app.js

public.post('/login', function * (next) {
        passport.authenticate('WindowsAuthentication', {
            successRedirect: '/succ',
            failureRedirect: '/fail',
            failureFlash: true
        });
    });

in auth.js

(function() {
    var passport = require('koa-passport'),
        WindowsStrategy = require('passport-windowsauth');

    passport.serializeUser(function(user, done) {
        done(null, user);
    });
    passport.deserializeUser(function(user, done) {
        done(null, user);
    });

    passport.use(new WindowsStrategy({
        ldap: {
            url: 'ldap://ads.hhh.com',
            base: 'dc=ads,dc=,dc=com',
            bindDN: '_app',
            bindCredentials: ''
        },
        integrated: false
    }, function(profile, done) {
        console.log('auth');
        if (profile) {
            console.log(profile);
            done(null, profile.name);
        } else
            done('Not authorized', null);
    }));
})();

I referred to this example and the LocalStrategy did work.
But when I submit the login form with "Windows Strategy" enabled it gives below output.
screen shot 2015-06-19 at 2 34 14 pm
Whereas I expect it to either go to /succ or /fail .

BTW when I run the program without the firewall I do get below message which makes me think that it is trying to access the server.
screen shot 2015-06-19 at 2 37 00 pm

I am actually not sure if the problem is with the module or my implementation. But still thought of asking.

Any direction will be much appreciated.

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

1 participant