php + OAuth Vkontakte

Discussion in 'PHP' started by Befan, 1 Sep 2012.

  1. Befan

    Befan New Member

    Joined:
    27 Mar 2012
    Messages:
    27
    Likes Received:
    0
    Reputations:
    0
    1.
    http://oauth.vk.com/authorize?client_id=APP_ID&scope=SETTINGS& redirect_uri=REDIRECT_URI& response_type=code

    Code получаю а вот с access_token проблема.

    как состороны сервера получить access_token , чтобы на стороне клиента не палить APP_SECRET .
    пробовал через cURL

    чтото не получается. подскажите как быть.
     
  2. kadukmm

    kadukmm New Member

    Joined:
    26 Oct 2009
    Messages:
    0
    Likes Received:
    2
    Reputations:
    0
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

    или через file_get_contents
     
  3. Gifts

    Gifts Green member

    Joined:
    25 Apr 2008
    Messages:
    2,494
    Likes Received:
    807
    Reputations:
    614
    Befan в $go - лишний слеш пятым символом
     
    _________________________
  4. M_script

    M_script Members of Antichat

    Joined:
    4 Nov 2004
    Messages:
    2,581
    Likes Received:
    1,317
    Reputations:
    1,557
    $go="https\://oauth.vk.com/access_token?client_id=3105736&client_secret=блабалаа&code="+$code;

    $go='https://oauth.vk.com/access_token?client_id=3105736&client_secret=блабалаа&code='.$code;
    $go="https://oauth.vk.com/access_token?client_id=3105736&client_secret=блабалаа&code=$code";
     
    sergei_petrovish likes this.