【问题标题】:Instagram OAuth not asking which account I want to give access toInstagram OAuth 没有询问我要授予哪个帐户访问权限
【发布时间】:2017-04-07 20:24:36
【问题描述】:

当我的应用程序点击授权 URL 时,它会跳过整个屏幕。它会自动抓取我的公司 Instagram 帐户,我不希望它也为我的用户抓取错误的帐户。

第一步:将您的用户引导至我们的授权网址

https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code

此时,我们向用户展示了一个登录屏幕,然后是 确认屏幕在哪里授予您的应用访问她的 Instagram 的权限 数据。

我可以通过.authorize_url 传递任何选项/参数以防止跳过身份验证页面吗?

  def authenticate
    redirect_to (Instagram.authorize_url(redirect_uri: redirect_uri))
  end

  def callback
    if params[:code]
      response = Instagram.get_access_token(params[:code], redirect_uri: redirect_uri)

【问题讨论】:

    标签: facebook oauth oauth-2.0 instagram instagram-api


    【解决方案1】:

    在使用 API 进行 oauth 登录之前,您必须先退出 Instagram。

    这是退出instgram的答案:how to logout completely from instagram account from my website

    【讨论】:

    • 嗯。考虑如何在我的身份验证路由之前运行https://instagram.com/accounts/logout
    • 当您显示具有“连接到 instagram”按钮的页面时,请准备好在该页面的脚本中注销。
    猜你喜欢
    • 2017-11-16
    • 1970-01-01
    • 1970-01-01
    • 2011-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多