Personal Forums

Bug Reporting

RSS Feed

redirect url donot match error

  1. my code is following and i am getting redirect url donot match error in response

    $params = "code=" . $code . "&grant_type=authorization_code" . "&client_id=" . CLIENT_ID . "&client_secret=" . CLIENT_SECRET . "&redirect_uri=" . REDIRECT_URI;

    $curl = curl_init($token_url); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);

    $json_response = curl_exec($curl);

    Message edited by mustafa turab 4 years ago

  2. koshi4 years ago

    Hi Mustafa,

    Redirect URIs that you provide in your first request:

    https://<host>/oauth/authorize?client_id=<id> &response_type=code &redirect_uri=<redirect URI> &scope=<resources to request> &update=<true/false>

    ...and subsequent access token request:

    POST : https://<host>/oauth/access_token Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    <post body> grant_type=authorization_code& code=<code>& client_id=<client id>& client_secret=<client secret provided during API approval>& redirect_uri=<redirect URI>

    ...must be the same. The reason you are getting that message is that they probably weren't.

[ Page 1 of 1 ]