Yes, you can do this. The only complication is that you'll need to store the password by returning a tag from the authenticator's authenticate function, as shown below:
function checkUserName(userName, userInfo) {
return userName=="test";
}
function authenticate(userName, password, authInfo) {
return {
isCorrectPassword: password=="test",
tags: {
password: password
}
};
}
Note that I've hardcoded it to accept only the credentials test/test.
Once you've done that you can access the user-name and password from any JSS process trigger as follows:
var userName = system.user.userName;
var password = system.user.tags.get("password");
Does that answer your question?