Adding a query parameter to the Instagram auth redirect_uri doesn't work?

后端 未结 3 1427
迷失自我
迷失自我 2021-01-17 11:41

Steps to reproduce

  1. Register a redirect_uri in the client: http://example.com/publisher/auth
  2. Direct a user to the /oauth/authorize endpoint with the
相关标签:
3条回答
  • 2021-01-17 12:21

    You have to provide the redirect_uri with your extra search params as the last parameter:

    https://www.instagram.com/oauth/authorize/?client_id=be1b911b487f4919b9c2fb7df0c4142c&type=web_server&response_type=code&scope=basic&redirect_uri=https://wpwifidemo.alepo.net/instagram/joinus/?inviteId=00001000-cf33-11e4-9f26-8789dd0b3e01

    User will be redirected to:

    https://wpwifidemo.alepo.net/instagram/joinus/?inviteId=00001000-cf33-11e4-9f26-8789dd0b3e01&code=CODE

    0 讨论(0)
  • 2021-01-17 12:25

    Had the same issue today. To get the custom data passed between requests you must include it as state param. My authorize request url looked something like this:

    https://www.instagram.com/oauth/authorize?client_id=SOME_CLIENT_ID&response_type=code&redirect_uri=http://example.com/auth/InstagramRedirect/&state=855C0114-F860-420A-AEB1-A276644FCCEA

    Notice the & and state=...

    0 讨论(0)
  • 2021-01-17 12:27

    It might be too late reply for this question. But i faced the same issue today & got this question already posted and solution for passing parameters to authentication URL is as follows.

    It seems that your extra parameter is type=web_server , taking that into consideration, your URL for getting for code should be as follows

    https://www.instagram.com/oauth/authorize/?client_id=be1b911b487f4919b9c2fb7df0c4142c&redirect_uri=https://wpwifidemo.alepo.net/instagram/joinus/?type=web_server&response_type=code&scope=basic

    And then while calling the accessToken API append your redirect_uri parameter with your passed parameter (not the same configured in the app). e.g.

    redirect_uri=http%3A%2F%2Fexample.com%2Fpublisher%2Fauth%3FinviteId%3D00001000-cf33-11e4-9f26-8789dd0b3e01?type=web_server

    0 讨论(0)
提交回复
热议问题