-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Hi @abbr,
I faced weird issues.
I and my colleague access the API (/test/login) at the same time(really fast) then I can get his username instead of my user name.
This is my implementation :
app.use(function(req, res, next) {
if (req.originalUrl === '/test/login') {
var nodeSSPI = require('node-sspi')
var nodeSSPIObj = new nodeSSPI({
retrieveGroups: true
})
nodeSSPIObj.authenticate(req, res, function(err) {
res.finished || next()
})
} else {
next()
}
})
app.get('/test/login', (req, res) => {
if (req.connection.user.trim() && (req.connection.user.split("\\")[1].trim())) {
const username = req.connection.user.split("\\")[1].trim()//=====> We will get the same user name here
res.redirect(`${process.env.LOGIN_REDIRECT}?username=${username}`);
} else {
res.redirect(process.env.LOGIN_REDIRECT);
}
})
Did I miss something in the configuration?
Metadata
Metadata
Assignees
Labels
No labels