EionRobb / purple-instagram

Instagram protocol plugin for libpurple
GNU General Public License v3.0
39 stars 4 forks source link

Login challenge is not working #20

Open marcodellomo opened 2 years ago

marcodellomo commented 2 years ago

To login i am requested to insert the 6 digits password sent me via email; i actually receive no email so i can not activate my user in a pidgin Instagram protocol...

fuzzy76 commented 2 years ago

If Instagram can't send you a mail, how is that a problem with this plugin?

blu256 commented 2 years ago

I can confirm this, the code got sent when I tried to log in via browser but it didn't when pidgin-instagram tried to connect.

The challenge request performed on line 899 seems to fail. This is the response to it:

{
  "message":"challenge_required",
  "challenge": {
    "url": "https://i.instagram.com/challenge/.../.../",
    "api_path": "/challenge/.../.../",
    "hide_webview_header": true,
    "lock": false,
    "logout": false,
    "native_flow": false,
    "flow_render_type": 4
   },
  "status": "fail"
}
blu256 commented 2 years ago

Temporary workaround:

  1. Comment out the challenge code:
    
    diff --git a/libinstagram.c b/libinstagram.c
    index e7f6d29..3d23a97 100644
    --- a/libinstagram.c
    +++ b/libinstagram.c
    @@ -890,6 +890,7 @@ ig_login_cb(InstagramAccount *ia, JsonNode *node, gpointer user_data)
                        purple_connection_error(ia->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, message);
                        purple_debug_error("instagram", "%s\n", message);

+#if 0 } else if (purple_strequal(json_object_get_string_member(response, "error_type"), "checkpoint_challenge_required")) { JsonObject challenge = json_object_get_object_member(response, "challenge"); const gchar challenge_api_path = json_object_get_string_member(challenge, "api_path"); @@ -907,6 +908,8 @@ ig_login_cb(InstagramAccount ia, JsonNode node, gpointer user_data) purple_request_cpar_from_connection(ia->pc), ia); } else if (json_object_has_member(response, "logged_in_user")) { +#endif

-#endif \ No newline at end of file +#endif


2. Create/Enable the Instagram account in Pidgin
3. Login to your Instagram account via a device you have previously used with Instagram
4. A prompt should pop up asking whether the latest log in was from you (select Yes it was me)
5. Pidgin should automatically work with your Instagram account
lazyest commented 2 years ago

wasn't able to patch code with this diff, is it still relevant to current codebase?

blu256 commented 2 years ago

@lazyest The codebase hasn't changed since 2019. Maybe you could try to do it manually? It's just an #ifdef 0 block inserted.

Industry commented 2 years ago

Would someone that's done the workout please compile the code into a new DLL for those that don't have coding skills :)

dchmelik commented 2 years ago

Temporary workaround: [...] Comment out the challenge code:

Looks more like a patch including additions and not just comment-out, which I run in sourcecode folder and see below.

The codebase hasn't changed since 2019. Maybe you could try to do it manually? It's just an #ifdef 0 block inserted.

There's more than that (I don't recall how to add patches manually).

d@cosmos:~/math/src/network/chat/bitlbee/plugins/purple-instagram$ patch -p1 < ../purple-instagram.patch 
patching file libinstagram.c
Hunk #1 FAILED at 890 (different line endings).
Hunk #2 FAILED at 907 (different line endings).
Hunk #3 FAILED at 1153 (different line endings).
paulsybrandy commented 2 years ago

Same issue and yes works on browser and get code but not with the plug-in. No coding skills either :(

xilvitron commented 1 year ago

Would someone that's done the workout please compile the code into a new DLL for those that don't have coding skills :)

Please, ¿can someone do what Industry said? Thanx.