formigarafa / robotito

Terminal shell accessible through a jabber connection
MIT License
72 stars 18 forks source link

How does it work with Gtalk ? #6

Closed NicolasDEVOUGE closed 7 years ago

NicolasDEVOUGE commented 7 years ago

Hello,

I have installed Robotito, configured a google account with, and started. It says :

:/opt/robotito# ./robotitod start -t Connecting... Connected.

So with my proper google account, I start gTalk, and start a chat with the google account configured in config/credentials.rb .

And now ... I don't know what can I do in order to get the bot :p Can you help me please ?

Regards,

Nicolas

formigarafa commented 7 years ago

Did you try to talk between both accounts on the gtalk client? The other account need to accept the invitation to chat.

NicolasDEVOUGE commented 7 years ago

Chat between two account is OK on gmail .

I have set configuration like this :


# Robo-TiTO connects to Jabber using these settings.
BOT_LOGIN         = "botmail@gmail.com"
BOT_PASSWORD      = "MyPasswordWith$and%"

# If you don't need the server settings set them to nil
# BOT_JABBER_HOST_SERVER = nil
# BOT_JABBER_SERVER_PORT = nil
#
# For google/gmail account use:
BOT_JABBER_HOST_SERVER = 'talk.google.com'
BOT_JABBER_SERVER_PORT = 5222

# Robo-TiTO only accepts commands from contacts listed on PASSWD hash.
PASSWD = {
  "nicolas" => "ABCDEFG33MMFZWIZLWN52WOZJWGE======",
}

So what's wrong in my settings ? :/

Thank you !

NicolasDEVOUGE commented 7 years ago

I have news, now when I start a chat, and I give my name (nicolas) , it ask me an authentification, I have tested with the clear version of base32 encoded, and with the encoded version, and it stop with this message :


`root@osmos-proxy-web-01:/opt/robotito# ./robotitod run
Connecting...
Connected.
/var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:43:in `decode_quint': Invalid Base32 Character - '=' (ROTP::Base32::Base32Error)
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:28:in `block in decode_block'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:28:in `each_char'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:28:in `each'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:28:in `map'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:28:in `decode_block'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:10:in `block in decode'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:9:in `each'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/base32.rb:9:in `decode'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/otp.rb:53:in `byte_secret'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/otp.rb:27:in `generate_otp'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/totp.rb:23:in `at'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/totp.rb:35:in `verify'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/totp.rb:71:in `block in verify_with_drift_and_prior'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/totp.rb:71:in `each'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/totp.rb:71:in `find'
        from /var/lib/gems/2.1.0/gems/rotp-3.3.0/lib/rotp/totp.rb:71:in `verify_with_drift_and_prior'
        from /opt/robotito/lib/otp_authenticator.rb:13:in `valid?'
        from /opt/robotito/lib/message_processor.rb:60:in `authentication_command'
        from /opt/robotito/lib/message_processor.rb:43:in `process'
        from /opt/robotito/lib/message_router.rb:12:in `dispatch'
        from /opt/robotito/lib/robotito.rb:21:in `block in run'
        from /opt/robotito/lib/jabber_client.rb:29:in `<<'
        from /opt/robotito/lib/jabber_client.rb:29:in `block (3 levels) in received_messages'
        from /var/lib/gems/2.1.0/bundler/gems/xmpp4r-simple-92e2cd0002ec/lib/xmpp4r-simple.rb:485:in `block in dequeue'
        from /var/lib/gems/2.1.0/bundler/gems/xmpp4r-simple-92e2cd0002ec/lib/xmpp4r-simple.rb:481:in `times'
        from /var/lib/gems/2.1.0/bundler/gems/xmpp4r-simple-92e2cd0002ec/lib/xmpp4r-simple.rb:481:in `dequeue'
        from /var/lib/gems/2.1.0/bundler/gems/xmpp4r-simple-92e2cd0002ec/lib/xmpp4r-simple.rb:225:in `received_messages'
        from /opt/robotito/lib/jabber_client.rb:27:in `block (2 levels) in received_messages'
        from /opt/robotito/lib/jabber_client.rb:26:in `loop'
        from /opt/robotito/lib/jabber_client.rb:26:in `block in received_messages'
        from /opt/robotito/lib/robotito.rb:20:in `each'
        from /opt/robotito/lib/robotito.rb:20:in `each'
        from /opt/robotito/lib/robotito.rb:20:in `run'
        from ./robotitod:9:in `block in <main>'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/application.rb:266:in `call'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/application.rb:266:in `block in start_proc'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/application.rb:275:in `call'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/application.rb:275:in `start_proc'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/application.rb:296:in `start'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/controller.rb:59:in `run'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons.rb:197:in `block in run_proc'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/cmdline.rb:92:in `call'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons/cmdline.rb:92:in `catch_exceptions'
        from /var/lib/gems/2.1.0/gems/daemons-1.2.4/lib/daemons.rb:196:in `run_proc'
        from ./robotitod:6:in `<main>'`

I think I have no problem with tour program, but with the documentation ;)

formigarafa commented 7 years ago

I am anything but a base32 expert, but I guess the = in the end are optional in some cases. They are used for padding when required and probably here they are simply not required. @hackman61 , If you don't mind could you please have another go using a base32 without the padding = characters.

If you want a little more documentation about the "One Time Password" generation and the key you are using, please refer to https://github.com/mdp/rotp . You can even find some examples and if you install the gem you can test some base32 secrets in the console.

$ > rotp --secret ABCDEFG33MMFZWIZLWN52WOZJWGE======
Secret must be in RFC4648 Base32 format - http://en.wikipedia.org/wiki/Base32#RFC_4648_Base32_alphabet
$ > rotp --secret ABCDEFG33MMFZWIZLWN52WOZJWGE
858865
NicolasDEVOUGE commented 7 years ago

It works ! In fact it was an mistake from myself concerning ====== in base32 ;) , AND in OTP usage, but now everything works , thank you very much !