dqx76962 2016-04-04 20:34
浏览 92

无法通过uber api授权,我有server_token,client_id和client_secret,如何发送请求?

Why do I get the error request uri?

https://login.uber.com/oauth/v2/authorize?response_type=code&client_id=".$settings['global']['clientId'].'&clientSecret="'.$settings['global']['clientSecret'].'&scope=all_trips&redirect_uri=http://'.$_SERVER['HTTP_HOST'].'token.php

  • 写回答

2条回答 默认 最新

  • dpquu9206 2016-04-04 21:50
    关注
    • For the GET /oauth/v2/authorize endpoint the clientSecret parameter that you send is not required and may interfere with some parameter validation on their backend. The parameters you need to pass are:

      response_type
      client_id
      scope
      state
      redirect_uri

      Read the above URL to understand what each parameter means.

    • Make sure the base of the URI you send in the query parameter redirect_uri to the GET https://login.uber.com/oauth/v2/authorize endpoint matches the one defined in the Uber Developers Dashboard for your app, Authorizations tab.

      As the docs for the authorize OAuth request says:

      redirect_uri (optional) The URI we will redirect back to after an authorization by the resource owner.
      The base of the URI must match the redirect_uri used during the registration of your application.

      The redirect URL can be:

      1. localhost

        http://::1
        http://127.0.0.1
        http://localhost

      2. any HTTPS:// URL

        https://

      3. a custom scheme

        custom-scheme://

    • Make sure your redirect URI is HTTPS enabled

      According to the same authorization and authentication documentation:

      The Uber API implements the OAuth 2.0 standard for secure authentication and authorization.  
      All communication with our servers must be over SSL (https://).
      

      For getting a TLS certificate at no cost for your domain I recommend Let's Encrypt Certificate Authority

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据