V
V
Valery2018-09-23 13:19:28
API
Valery, 2018-09-23 13:19:28

How to solve "Challenge required" in mgp25/instagram-api?

Hello.
I implement authorization in Instagram using PrivateAPI and an extension from mgp25 - https://github.com/mgp25/Instagram-API.
When authorizing from a new IP - insta responds with "Challenge required", which means that you need to enter a confirmation code from SMS or email.
I found the most complete analysis of the problem in this issue - https://github.com/mgp25/Instagram-API/issues/2143.
Following this answer ( https://github.com/mgp25/Instagram-API/issues/2143...implemented the functionality and now in case of a response with a request to enter a code, another request is programmatically emulated, an SMS arrives on the phone, I enter it (moreover, entering the code incorrectly leads to an error - i.e. at this moment everything is correct) and I receive a message about successful authorization - the user's pk and other data come in the response.
The problem is that when I call the method again, I get prompted for input again. Those. the library does not save a successful entry, or something still comes up wrong.
I ask for help in resolving the issue - a lot of time was spent looking for a solution.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Komlev, 2020-02-10
@SerjAir

There is a simpler solution than enabling/disabling two-factor authentication. Subscribe if this is still relevant to you.

P
Puma Thailand, 2018-09-23
@opium

See how it's done in other API implementations.

H
holden321, 2018-11-26
@holden321

In step 2, you must use the _uid returned from step 1.
That is, roughly speaking:
->addPost('_uid', $customResponse['user_id'])
instead
of ->addPost('_uid', $ig->account_id)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question