I'd like to allow two factor with Google authenticator.
##
<bountysource-plugin>
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1589520-expand-with-api-to-allow-challenge-response?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).
</bountysource-plugin>
<!-- github-sync-id:31305855 -->
Might help to mention which API you mean specifically. Does Google run an IRC network with a two factor login authentication?
Might help to mention which API you mean specifically. Does Google run an IRC network with a two factor login authentication?
<!-- github-comment-id:40178057 -->
Uhm. Isn't this already possible? Just return HALT from OnLoginAttempt() and your code has all the time it needs to do whatever it wants to the login attempt...?
Uhm. Isn't this already possible? Just `return HALT` from `OnLoginAttempt()` and your code has all the time it needs to do whatever it wants to the login attempt...?
<!-- github-comment-id:40184138 -->
OnUnknownUserRaw(). And you can keep the CSmartPtr<CAuthBase> that OnLoginAttempt() around as long as you want and only later call functions on it. (But please note that the socket timeout is still active and if you wait too long, the socket might already be gone again. You can stil call the "auth successful" functions after this, but they won't do anything. If this is a problem, you'd have to mess with / disable this timeout. Which isn't necesarily the best idea...)
`OnUnknownUserRaw()`. And you can keep the `CSmartPtr<CAuthBase>` that `OnLoginAttempt()` around as long as you want and only later call functions on it. (But please note that the socket timeout is still active and if you wait too long, the socket might already be gone again. You can stil call the "auth successful" functions after this, but they won't do anything. If this is a problem, you'd have to mess with / disable this timeout. Which isn't necesarily the best idea...)
<!-- github-comment-id:40188287 -->
Which pointer do you want to keep? All that OnLoginAttempt() gives you is a CAuthBase. From this you can get the username, password, socket and remote ip. The socket automatically becomes NULL if the other end e.g. disconnects or "dies from a timeout", so be sure to handle this correctly.
And the CSmartPtr can just be copied around like an int...
And remember that there is more than just IRC auth. This will also be called for web auth!
Which pointer do you want to keep? All that `OnLoginAttempt()` gives you is a CAuthBase. From this you can get the username, password, socket and remote ip. The socket automatically becomes NULL if the other end e.g. disconnects or "dies from a timeout", so be sure to handle this correctly.
And the CSmartPtr can just be copied around like an int...
And remember that there is more than just IRC auth. This will also be called for web auth!
<!-- github-comment-id:40190145 -->
EWhat if two clients for the same user both have auth sessions. How do I get the correct AuthPointer to accept? Only thing I can think of is one PASS accepting all open AuthPointers for the user. That mightn't be a bad idea given all my networks.
EWhat if two clients for the same user both have auth sessions. How do I get the correct AuthPointer to accept? Only thing I can think of is one PASS accepting all open AuthPointers for the user. That mightn't be a bad idea given all my networks.
<!-- github-comment-id:40256393 -->
Your OnLoginAttempt will be called once per client, each time with CAuthBase of that particular client. It's your module's job to determine, whether the client is authenticated or not, and which user is it authorized as.
Your `OnLoginAttempt` will be called once per client, each time with `CAuthBase` of that particular client. It's your module's job to determine, whether the client is authenticated or not, and which user is it authorized as.
<!-- github-comment-id:40256899 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I'd like to allow two factor with Google authenticator.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1589520-expand-with-api-to-allow-challenge-response?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).Might help to mention which API you mean specifically. Does Google run an IRC network with a two factor login authentication?
Sorry, stupid auto correct. Should say auth api, ie don't fully log in until after additional communication.
Scenario: log in as normal
*2fa msgs user.
User must present correct code via pm to *2fa before login continues.
Uhm. Isn't this already possible? Just
return HALTfromOnLoginAttempt()and your code has all the time it needs to do whatever it wants to the login attempt...?I believe this is too early for messaging. Can I use OnRaw to get additional PASS lines maybe?
OnUnknownUserRaw(). And you can keep theCSmartPtr<CAuthBase>thatOnLoginAttempt()around as long as you want and only later call functions on it. (But please note that the socket timeout is still active and if you wait too long, the socket might already be gone again. You can stil call the "auth successful" functions after this, but they won't do anything. If this is a problem, you'd have to mess with / disable this timeout. Which isn't necesarily the best idea...)I'll attempt this, thanks. How would I keep the pointer if multiple clients are connected to one user.
Which pointer do you want to keep? All that
OnLoginAttempt()gives you is a CAuthBase. From this you can get the username, password, socket and remote ip. The socket automatically becomes NULL if the other end e.g. disconnects or "dies from a timeout", so be sure to handle this correctly.And the CSmartPtr can just be copied around like an int...
And remember that there is more than just IRC auth. This will also be called for web auth!
EWhat if two clients for the same user both have auth sessions. How do I get the correct AuthPointer to accept? Only thing I can think of is one PASS accepting all open AuthPointers for the user. That mightn't be a bad idea given all my networks.
Your
OnLoginAttemptwill be called once per client, each time withCAuthBaseof that particular client. It's your module's job to determine, whether the client is authenticated or not, and which user is it authorized as.