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

Support for creds in headers and authorization #30

Closed
wants to merge 2 commits into from

Conversation

dkhunt27
Copy link

  • added support for user/pass in headers
  • added support for to pass authentication options back to verify function; this will allow for authorization.

for instance

  • app.post("/someAdminSerice", passport.authenticate('ldapauth', { authorizatioRole:"admin" }), function(req, res) {....});
  • app.post("/somePublicSerice", passport.authenticate('ldapauth', { authorizatioRole:"public" }), function(req, res) {....});

And in the verify function, you can check to see if those roles are associated with that user.

@vesse
Copy link
Owner

vesse commented Jun 3, 2015

Hi,

You can easily use custom callback to achieve the authorization, eg.

app.post('/someAdminService', function(req, res, next) {
  passport.authenticate('ldapauth', function(err, user, info) {
    // Handle authorization here
  })(req, res, next);
});

Adding basic auth has already been proposed in #4 and can be achieved with passport-http and ldapauth-fork.

@vesse vesse closed this Jun 3, 2015
@vesse vesse mentioned this pull request Sep 13, 2016
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

Successfully merging this pull request may close these issues.

2 participants