GithubHelp home page GithubHelp logo

2FA about bitlbee-discord HOT 11 CLOSED

sm00th avatar sm00th commented on July 19, 2024
2FA

from bitlbee-discord.

Comments (11)

sm00th avatar sm00th commented on July 19, 2024 1

4697fef adds support for two-factor auth with TOTP token. I tested it with one of my accounts but can you try it out before we close the issue?

Please note that there might be a slight delay(up to 2 seconds) between the time you type in the code and the time it is actually sent to discord, so try not to use TOTP tokens that are about to expire.

from bitlbee-discord.

sm00th avatar sm00th commented on July 19, 2024 1

Do you happen to have " character in your password? If so d085abf should fix your issue. If not: are there any other non-alphanumeric characters in your password?

from bitlbee-discord.

sm00th avatar sm00th commented on July 19, 2024

Can't find anything about this in discord's API reference, so doubt it. In fact we should switch from password auth to OAuth2.

Is there any way to use Two-Factor Authentication with this?

Sent from my Android device with K-9 Mail. Please excuse my brevity.

from bitlbee-discord.

Kays avatar Kays commented on July 19, 2024

So um ... how are you connecting to Discord with this? Do I have to disable 2FA?

from bitlbee-discord.

sm00th avatar sm00th commented on July 19, 2024

I've taken a look and oauth seems to be bot-oriented so it won't give an application permission to post messages in your name, and they don't have any documentation on 2fa, so I'll have to see how the webclient does it and try to mimick it.
Can't give any time frame atm, so unfortunately bitlbee-discord won't work with 2fa enabled right now.

from bitlbee-discord.

Kays avatar Kays commented on July 19, 2024

Okay. I guess I am okay to have it disabled. Only issue would be for that one server that requires 2FA for admin privs.

from bitlbee-discord.

erockce avatar erockce commented on July 19, 2024

Thank you for implementing this feature. I must be doing something wrong however using the module.

After building the latest changes from master and adding it to my bitlbee installation (using Ubuntu 16.04.1 LTS, bitlbee 3.4.2-0ubuntu1), I'm performed the following steps:

  1. acc add discord <email address>
  2. /OPER <email address> <account password>
  3. acc discord on

Status returned with ac l shows the discord account as "Connecting". Eventually I get Connection timeout...signing off...Reconnecting in 5 seconds.

I never was prompted to provide a token. I believe that I have the module properly installed and can run strings /usr/lib/bitlbee/discord.so to show the output of 2FA token message prompts match the recent code changes.

Are there any variables to enable more logging without having to use a debug symbol-compiled version of bitlbee to troubleshoot further?

from bitlbee-discord.

sm00th avatar sm00th commented on July 19, 2024

Looks like for some reason it doesn't realize it needs to use mfa. Unfortunately there is no in place debug info, but you can use the following simple patch to for debugging.
After applying this run bitlbee with a bitlbee -nvD command, then connect as usual and do the acc discord on.

You should get a line like this:
discord_http_login_cb: { "mfa": true, "token": null, "ticket": "xxx" }

At least that is what bitlbee-discord expects when two-factor is enabled. If the output you get is any different please post it here (remove "token" and/or "ticket" values though).

from bitlbee-discord.

erockce avatar erockce commented on July 19, 2024

Well...Here is the bitlbee stdout with your patch against discord-http.c and after issuing ac discord on:

erockce@nuc:~ $ sudo bitlbee -nvD
discord_http_login_cb: {"code": 0, "message": "400: Bad Request"}

Not sure if this is relevant but researching earlier for logging examples in other issues, I found in 21#issuecomment-196945011 and when querying discordapp.com the response for me is:

erockce@nuc:~ $ curl -L http://discordapp.com/api/gateway
{"url": "wss://gateway.discord.gg"}

I tried setting BITLBEE_DEBUG=1 like @bleader used from 21#issuecomment-197243083 before running bitlbee -nvD but there were no additional logging messages in the output or /var/log/syslog for me.

FWIW, here was the result of patching and making:

erockce@ubuntu:~/Development/bitlbee-discord {mychanges 4697fef} $ patch -p 1 < ~/mfa_debug.patch 
patching file src/discord-http.c
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 147 with fuzz 1.

...

erockce@ubuntu:~/Development/bitlbee-discord {mychanges *% 4697fef} $ make
Making all in src
make[1]: Entering directory '/home/erockce/Development/bitlbee-discord/src'
  CC       discord_la-discord-http.lo
discord-http.c: In function ‘discord_http_mfa_cb’:
discord-http.c:140:5: warning: format not a string literal and no format arguments [-Wformat-security]
     imcb_error(ic, (char*)json_o_str(js, "message"));
     ^
discord-http.c: In function ‘discord_http_login_cb’:
discord-http.c:188:7: warning: format not a string literal and no format arguments [-Wformat-security]
       imcb_error(ic, err->str);
       ^
  CCLD     discord.la
make[1]: Leaving directory '/home/erockce/Development/bitlbee-discord/src'
make[1]: Entering directory '/home/erockce/Development/bitlbee-discord'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/erockce/Development/bitlbee-discord'

And here are the version of the packages (dev = ubuntu and operational = nuc environments):

erockce@ubuntu:~ $ for i in bitlbee-dev libglib2.0-dev ; do echo "---" ; dpkg -s $i | egrep '^Package|^Version' ; done
---
Package: bitlbee-dev
Version: 3.4.2-0ubuntu1
---
Package: libglib2.0-dev
Version: 2.48.1-1~ubuntu16.04.1

...

erockce@nuc:~ $ dpkg -s bitlbee | egrep '^Package|^Version'
Package: bitlbee
Version: 3.4.2-0ubuntu1

I use the facebook and steam plugins and both connect to their servers so Bitlbee is working.

from bitlbee-discord.

erockce avatar erockce commented on July 19, 2024

Yes there is and other special characters. I try to use strong passwords whenever possible. :)

Just updated and tested. 2FA works now!

from bitlbee-discord.

Kays avatar Kays commented on July 19, 2024

Hi @sm00th sorry I'm late on this. Works for me too and a big thanks for implementing this. :D

from bitlbee-discord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.