nandub / hubot-irc

IRC adapter for Hubot
MIT License
299 stars 128 forks source link

Use authentication info as user.id if available. #125

Open docwhat opened 10 years ago

docwhat commented 10 years ago

If the IRC server(s) uses authentication, the user.id should match the authenticated identity instead of the user's nick.

This would allow mapping user names to an actual identity in an organization. Such as for notifications, permissions, etc.

It shouldn't be turned on by default, it should require a setting of some sort.

On our system, we're using ngirc with the PAM plugin to authenticate. I can help set up a test system for you if you want.

martinb3 commented 10 years ago

While undocumented, HUBOT_IRC_USERNAME appears to do what you want.

docwhat commented 10 years ago

@martinb3 That's actually is for logging hubot into an authenticated irc server.

I'm saying, I have hubot on an authenticated irc server and the user.id reported for a specific user is their nickname. It would be better if the user.id was the username that the user authenticated against IRC with.

e.g. I log into the IRC server with username 'docwhat' and password 'sekret'. I then run /nick joecool. I expect hubot to record my user.id as 'docwhat' (not 'joecool').

Sorry, this is hard to explain. :-/

martinb3 commented 10 years ago

e.g. I log into the IRC server with username 'docwhat' and password 'sekret'. I then run /nick joecool. I expect hubot to record my user.id as 'docwhat' (not 'joecool').

If I connect as nick joecool and HUBOT_IRC_USERNAME=docwhat, I get the end state you're describing. Is it only because you're changing nicks after you login? BTW, the NICK is sent during authentication as well, it isn't something that normally happens after (often pass, then nick, then user) -- and hubot-irc is sending all three based on the three separate settings for nick, password, and user.

docwhat commented 10 years ago

Ah. I see how I was failing to explain.

My hubot is called "hubot".

I am called "docwhat".

I'm asking about the user.id for storing other IRC users in the brain.